Record Class PartyInvitation

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.party.PartyInvitation
Record Components:
inviterId - the party leader who sent it
inviteeId - the invited player
partyId - the party the invitee would join
expiresAt - when it expires, in epoch milliseconds

public record PartyInvitation(@NotNull UUID inviterId, @NotNull UUID inviteeId, @NotNull UUID partyId, long expiresAt) extends Record
A pending party invitation. A snapshot: accepting, denying or expiring it does not change it.
Since:
1.8.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    How an invitation ended.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PartyInvitation(@NotNull UUID inviterId, @NotNull UUID inviteeId, @NotNull UUID partyId, long expiresAt)
    Creates an instance of a PartyInvitation record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the expiresAt record component.
    final int
    Returns a hash code value for this object.
    @NotNull UUID
    Returns the value of the inviteeId record component.
    @NotNull UUID
    Returns the value of the inviterId record component.
    boolean
    Whether it has expired by now.
    @NotNull UUID
    Returns the value of the partyId record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PartyInvitation

      public PartyInvitation(@NotNull @NotNull UUID inviterId, @NotNull @NotNull UUID inviteeId, @NotNull @NotNull UUID partyId, long expiresAt)
      Creates an instance of a PartyInvitation record class.
      Parameters:
      inviterId - the value for the inviterId record component
      inviteeId - the value for the inviteeId record component
      partyId - the value for the partyId record component
      expiresAt - the value for the expiresAt record component
  • Method Details

    • isExpired

      public boolean isExpired()
      Whether it has expired by now.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • inviterId

      @NotNull public @NotNull UUID inviterId()
      Returns the value of the inviterId record component.
      Returns:
      the value of the inviterId record component
    • inviteeId

      @NotNull public @NotNull UUID inviteeId()
      Returns the value of the inviteeId record component.
      Returns:
      the value of the inviteeId record component
    • partyId

      @NotNull public @NotNull UUID partyId()
      Returns the value of the partyId record component.
      Returns:
      the value of the partyId record component
    • expiresAt

      public long expiresAt()
      Returns the value of the expiresAt record component.
      Returns:
      the value of the expiresAt record component