Record Class ArenaView

java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.arena.ArenaView

@AnyThread public record ArenaView(@NotNull String id, @Nullable String worldName, boolean enabled, boolean conveyorValid, @Nullable org.bukkit.Location pos1, @Nullable org.bukkit.Location pos2, @Nullable org.bukkit.Location conveyorStart, @Nullable org.bukkit.Location conveyorEnd, @NotNull List<PlotView> plots) extends Record
Immutable snapshot of an arena and its plots.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ArenaView(@NotNull String id, @Nullable String worldName, boolean enabled, boolean conveyorValid, @Nullable org.bukkit.Location pos1, @Nullable org.bukkit.Location pos2, @Nullable org.bukkit.Location conveyorStart, @Nullable org.bukkit.Location conveyorEnd, @NotNull List<PlotView> plots)
    Creates an instance of a ArenaView record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    @Nullable org.bukkit.Location
    Returns the value of the conveyorEnd record component.
    @Nullable org.bukkit.Location
    Returns the value of the conveyorStart record component.
    boolean
    Returns the value of the conveyorValid record component.
    boolean
    Returns the value of the enabled record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull String
    id()
    Returns the value of the id record component.
    int
     
    @NotNull List<PlotView>
    Returns the value of the plots record component.
    @Nullable org.bukkit.Location
    Returns the value of the pos1 record component.
    @Nullable org.bukkit.Location
    Returns the value of the pos2 record component.
    final String
    Returns a string representation of this record class.
    @Nullable String
    Returns the value of the worldName record component.

    Methods inherited from class Object

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

    • ArenaView

      public ArenaView(@NotNull @NotNull String id, @Nullable @Nullable String worldName, boolean enabled, boolean conveyorValid, @Nullable @Nullable org.bukkit.Location pos1, @Nullable @Nullable org.bukkit.Location pos2, @Nullable @Nullable org.bukkit.Location conveyorStart, @Nullable @Nullable org.bukkit.Location conveyorEnd, @NotNull @NotNull List<PlotView> plots)
      Creates an instance of a ArenaView record class.
      Parameters:
      id - the value for the id record component
      worldName - the value for the worldName record component
      enabled - the value for the enabled record component
      conveyorValid - the value for the conveyorValid record component
      pos1 - the value for the pos1 record component
      pos2 - the value for the pos2 record component
      conveyorStart - the value for the conveyorStart record component
      conveyorEnd - the value for the conveyorEnd record component
      plots - the value for the plots record component
  • Method Details

    • availablePlotCount

      public int availablePlotCount()
    • occupiedPlotCount

      public int occupiedPlotCount()
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • id

      @NotNull public @NotNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • worldName

      @Nullable public @Nullable String worldName()
      Returns the value of the worldName record component.
      Returns:
      the value of the worldName record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • conveyorValid

      public boolean conveyorValid()
      Returns the value of the conveyorValid record component.
      Returns:
      the value of the conveyorValid record component
    • pos1

      @Nullable public @Nullable org.bukkit.Location pos1()
      Returns the value of the pos1 record component.
      Returns:
      the value of the pos1 record component
    • pos2

      @Nullable public @Nullable org.bukkit.Location pos2()
      Returns the value of the pos2 record component.
      Returns:
      the value of the pos2 record component
    • conveyorStart

      @Nullable public @Nullable org.bukkit.Location conveyorStart()
      Returns the value of the conveyorStart record component.
      Returns:
      the value of the conveyorStart record component
    • conveyorEnd

      @Nullable public @Nullable org.bukkit.Location conveyorEnd()
      Returns the value of the conveyorEnd record component.
      Returns:
      the value of the conveyorEnd record component
    • plots

      @NotNull public @NotNull List<PlotView> plots()
      Returns the value of the plots record component.
      Returns:
      the value of the plots record component