Record Class RejoinStatus

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.rejoin.RejoinStatus
Record Components:
playerId - the player
eligibility - whether they can rejoin now, and if not, why
game - the match they would return to, when they still hold a return
corpse - 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 Details

    • RejoinStatus

      public RejoinStatus(@NotNull @NotNull UUID playerId, @NotNull @NotNull RejoinEligibility eligibility, @Nullable @Nullable ZentrixGame game, @Nullable @Nullable ZentrixCorpse corpse)
      Creates an instance of a RejoinStatus record class.
      Parameters:
      playerId - the value for the playerId record component
      eligibility - the value for the eligibility record component
      game - the value for the game record component
      corpse - the value for the corpse record component
  • Method Details

    • isEligible

      public boolean isEligible()
      Whether the player can rejoin now.
    • gameIfAny

      @NotNull public @NotNull Optional<ZentrixGame> gameIfAny()
      The match they would return to.
    • corpseIfAny

      @NotNull public @NotNull Optional<ZentrixCorpse> corpseIfAny()
      The corpse that holds their return.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • playerId

      @NotNull public @NotNull UUID playerId()
      Returns the value of the playerId record component.
      Returns:
      the value of the playerId record component
    • eligibility

      @NotNull public @NotNull RejoinEligibility eligibility()
      Returns the value of the eligibility record component.
      Returns:
      the value of the eligibility record component
    • game

      @Nullable public @Nullable ZentrixGame game()
      Returns the value of the game record component.
      Returns:
      the value of the game record component
    • corpse

      @Nullable public @Nullable ZentrixCorpse corpse()
      Returns the value of the corpse record component.
      Returns:
      the value of the corpse record component