Record Class ArenaSourceRequest

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.arena.ArenaSourceRequest
Record Components:
purpose - why the source is needed
gameTypeName - the game-types.yml name the source will be played under
requesterId - the player the request is made for, or null for a server-side request
requesterName - the display name of that player, empty when there is none

public record ArenaSourceRequest(@NotNull ArenaSourcePurpose purpose, @NotNull String gameTypeName, @Nullable UUID requesterId, @NotNull String requesterName) extends Record
What Zentrix wants a source arena for.

A provider may use the game type to pick a suitable source, but is never required to: Zentrix applies the requested game type to whatever source it is handed.

  • Constructor Details

    • ArenaSourceRequest

      public ArenaSourceRequest(@NotNull @NotNull ArenaSourcePurpose purpose, @NotNull @NotNull String gameTypeName, @Nullable @Nullable UUID requesterId, @NotNull @NotNull String requesterName)
      Creates an instance of a ArenaSourceRequest record class.
      Parameters:
      purpose - the value for the purpose record component
      gameTypeName - the value for the gameTypeName record component
      requesterId - the value for the requesterId record component
      requesterName - the value for the requesterName record component
  • Method Details

    • getRequesterId

      @NotNull public @NotNull Optional<UUID> getRequesterId()
    • 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.
    • purpose

      @NotNull public @NotNull ArenaSourcePurpose purpose()
      Returns the value of the purpose record component.
      Returns:
      the value of the purpose record component
    • gameTypeName

      @NotNull public @NotNull String gameTypeName()
      Returns the value of the gameTypeName record component.
      Returns:
      the value of the gameTypeName record component
    • requesterId

      @Nullable public @Nullable UUID requesterId()
      Returns the value of the requesterId record component.
      Returns:
      the value of the requesterId record component
    • requesterName

      @NotNull public @NotNull String requesterName()
      Returns the value of the requesterName record component.
      Returns:
      the value of the requesterName record component