Record Class PlayerLifecycle
java.lang.Object
java.lang.Record
dev.ua.theroer.magicutils.platform.PlayerLifecycle
- Record Components:
playerId- stable player id when availableplayerName- current player display/login nametype- lifecycle transition type
public record PlayerLifecycle(UUID playerId, String playerName, PlayerLifecycleType type)
extends Record
Normalized player join/leave event emitted by the platform layer.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerLifecycle(UUID playerId, String playerName, PlayerLifecycleType type) Creates an instance of aPlayerLifecyclerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisValid()Returns true when the payload contains enough data to process safely.playerId()Returns the value of theplayerIdrecord component.Returns the value of theplayerNamerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
PlayerLifecycle
Creates an instance of aPlayerLifecyclerecord class.- Parameters:
playerId- the value for theplayerIdrecord componentplayerName- the value for theplayerNamerecord componenttype- the value for thetyperecord component
-
-
Method Details
-
isValid
public boolean isValid()Returns true when the payload contains enough data to process safely.- Returns:
- true for non-empty player name and non-null lifecycle type
-
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). -
playerId
-
playerName
Returns the value of theplayerNamerecord component.- Returns:
- the value of the
playerNamerecord component
-
type
-