Record Class AnvilSlotView

java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.storage.AnvilSlotView

@AnyThread public record AnvilSlotView(@NotNull org.bukkit.Location anvilLocation, @Nullable org.bukkit.Location plateLocation, boolean occupied, @Nullable StoredBlockView storedBlock) extends Record
Immutable view of a paired anvil + pressure plate storage slot inside a plot.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnvilSlotView(@NotNull org.bukkit.Location anvilLocation, @Nullable org.bukkit.Location plateLocation, boolean occupied, @Nullable StoredBlockView storedBlock)
    Creates an instance of a AnvilSlotView record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.bukkit.Location
    Returns the value of the anvilLocation record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the occupied record component.
    @Nullable org.bukkit.Location
    Returns the value of the plateLocation record component.
    @Nullable StoredBlockView
    Returns the value of the storedBlock record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • AnvilSlotView

      public AnvilSlotView(@NotNull @NotNull org.bukkit.Location anvilLocation, @Nullable @Nullable org.bukkit.Location plateLocation, boolean occupied, @Nullable @Nullable StoredBlockView storedBlock)
      Creates an instance of a AnvilSlotView record class.
      Parameters:
      anvilLocation - the value for the anvilLocation record component
      plateLocation - the value for the plateLocation record component
      occupied - the value for the occupied record component
      storedBlock - the value for the storedBlock record component
  • Method Details

    • 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.
    • anvilLocation

      @NotNull public @NotNull org.bukkit.Location anvilLocation()
      Returns the value of the anvilLocation record component.
      Returns:
      the value of the anvilLocation record component
    • plateLocation

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

      public boolean occupied()
      Returns the value of the occupied record component.
      Returns:
      the value of the occupied record component
    • storedBlock

      @Nullable public @Nullable StoredBlockView storedBlock()
      Returns the value of the storedBlock record component.
      Returns:
      the value of the storedBlock record component