Record Class StructureOwner

java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.core.structures.StructureOwner
Record Components:
structureUID - The UID of the structure that is owned.
permission - The PermissionLevel level at which the player owns the structure.
playerData - The IPlayer object represented by this StructureOwner.

public record StructureOwner(long structureUID, PermissionLevel permission, PlayerData playerData) extends Record
Contains all details needed about the owner of a Structure.
  • Constructor Details

    • StructureOwner

      public StructureOwner(long structureUID, PermissionLevel permission, PlayerData playerData)
      Creates an instance of a StructureOwner record class.
      Parameters:
      structureUID - the value for the structureUID record component
      permission - the value for the permission record component
      playerData - the value for the playerData record component
  • Method Details

    • matches

      public boolean matches(ICommandSender commandSender)
      Checks if a command sender is the same as the player represented by this StructureOwner.
      Parameters:
      commandSender - The ICommandSender to check against.
      Returns:
      true if the command sender is the same as the one represented by this StructureOwner.
    • 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.
    • structureUID

      public long structureUID()
      Returns the value of the structureUID record component.
      Returns:
      the value of the structureUID record component
    • permission

      public PermissionLevel permission()
      Returns the value of the permission record component.
      Returns:
      the value of the permission record component
    • playerData

      public PlayerData playerData()
      Returns the value of the playerData record component.
      Returns:
      the value of the playerData record component