Record Class PlayerDisciplinaryAction
java.lang.Object
java.lang.Record
fr.prodrivers.bukkit.commons.storage.player.PlayerDisciplinaryAction
@Entity
public record PlayerDisciplinaryAction(UUID disciplinedPlayer, PlayerDisciplinaryAction.ActionType type, String message, Date expiration, UUID decider)
extends Record
Player Disciplinary Action
Record that represents a disciplinary action taken against a player, with an optional message and expiration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes the possible disciplinary actions -
Constructor Summary
ConstructorsConstructorDescriptionPlayerDisciplinaryAction(UUID disciplinedPlayer, PlayerDisciplinaryAction.ActionType type, String message, Date expiration, UUID decider) Creates an instance of aPlayerDisciplinaryActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondecider()Returns the value of thedeciderrecord component.Returns the value of thedisciplinedPlayerrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpirationrecord component.final inthashCode()Returns a hash code value for this object.booleanGet if the disciplinary action is still applicable at current timemessage()Returns the value of themessagerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
PlayerDisciplinaryAction
public PlayerDisciplinaryAction(UUID disciplinedPlayer, PlayerDisciplinaryAction.ActionType type, String message, Date expiration, UUID decider) Creates an instance of aPlayerDisciplinaryActionrecord class.- Parameters:
disciplinedPlayer- the value for thedisciplinedPlayerrecord componenttype- the value for thetyperecord componentmessage- the value for themessagerecord componentexpiration- the value for theexpirationrecord componentdecider- the value for thedeciderrecord component
-
-
Method Details
-
isApplicable
public boolean isApplicable()Get if the disciplinary action is still applicable at current time- Returns:
trueif disciplinary action is to be upheld
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
disciplinedPlayer
Returns the value of thedisciplinedPlayerrecord component.- Returns:
- the value of the
disciplinedPlayerrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
expiration
Returns the value of theexpirationrecord component.- Returns:
- the value of the
expirationrecord component
-
decider
Returns the value of thedeciderrecord component.- Returns:
- the value of the
deciderrecord component
-