Record Class RejoinStatus
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.rejoin.RejoinStatus
- Record Components:
playerId- the playereligibility- whether they can rejoin now, and if not, whygame- the match they would return to, when they still hold a returncorpse- the corpse that holds their return, when there is one
public record RejoinStatus(@NotNull UUID playerId, @NotNull RejoinEligibility eligibility, @Nullable ZentrixGame game, @Nullable ZentrixCorpse corpse)
extends Record
Whether a player can return to the match they left, and through which corpse.
- Since:
- 1.8.0
-
Constructor Summary
ConstructorsConstructorDescriptionRejoinStatus(@NotNull UUID playerId, @NotNull RejoinEligibility eligibility, @Nullable ZentrixGame game, @Nullable ZentrixCorpse corpse) Creates an instance of aRejoinStatusrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable ZentrixCorpsecorpse()Returns the value of thecorpserecord component.@NotNull Optional<ZentrixCorpse> The corpse that holds their return.@NotNull RejoinEligibilityReturns the value of theeligibilityrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable ZentrixGamegame()Returns the value of thegamerecord component.@NotNull Optional<ZentrixGame> The match they would return to.final inthashCode()Returns a hash code value for this object.booleanWhether the player can rejoin now.@NotNull UUIDplayerId()Returns the value of theplayerIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RejoinStatus
public RejoinStatus(@NotNull @NotNull UUID playerId, @NotNull @NotNull RejoinEligibility eligibility, @Nullable @Nullable ZentrixGame game, @Nullable @Nullable ZentrixCorpse corpse) Creates an instance of aRejoinStatusrecord class.- Parameters:
playerId- the value for theplayerIdrecord componenteligibility- the value for theeligibilityrecord componentgame- the value for thegamerecord componentcorpse- the value for thecorpserecord component
-
-
Method Details
-
isEligible
public boolean isEligible()Whether the player can rejoin now. -
gameIfAny
The match they would return to. -
corpseIfAny
The corpse that holds their return. -
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). -
playerId
Returns the value of theplayerIdrecord component.- Returns:
- the value of the
playerIdrecord component
-
eligibility
Returns the value of theeligibilityrecord component.- Returns:
- the value of the
eligibilityrecord component
-
game
Returns the value of thegamerecord component.- Returns:
- the value of the
gamerecord component
-
corpse
Returns the value of thecorpserecord component.- Returns:
- the value of the
corpserecord component
-