Record Class PunishmentDetailsCalculator.CalculationResult
java.lang.Object
java.lang.Record
space.arim.libertybans.api.punish.PunishmentDetailsCalculator.CalculationResult
- Record Components:
type- the typereason- the reasonduration- the duration of the punishment starting now,Duration.ZEROfor permanentscope- the scope
- Enclosing interface:
PunishmentDetailsCalculator
public static record PunishmentDetailsCalculator.CalculationResult(PunishmentType type, String reason, Duration duration, ServerScope scope)
extends Record
The computed details of a punishment
-
Constructor Summary
ConstructorsConstructorDescriptionCalculationResult(PunishmentType type, String reason, Duration duration, ServerScope scope) Creates -
Method Summary
Modifier and TypeMethodDescriptionduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.reason()Returns the value of thereasonrecord component.scope()Returns the value of thescoperecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
CalculationResult
Creates- Parameters:
type- the typereason- the reasonduration- the duration of the punishment starting now,Duration.ZEROfor permanentscope- the scope- Throws:
IllegalArgumentException- ifdurationis negative, or if the punishment type isPunishmentType.KICKbut the duration is not permanent
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
-
reason
-
duration
-
scope
-