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- ThePermissionLevellevel at which the player owns the structure.playerData- TheIPlayerobject represented by thisStructureOwner.
public record StructureOwner(long structureUID, PermissionLevel permission, PlayerData playerData)
extends Record
Contains all details needed about the owner of a Structure.
-
Constructor Summary
ConstructorsConstructorDescriptionStructureOwner(long structureUID, PermissionLevel permission, PlayerData playerData) Creates an instance of aStructureOwnerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if a player is the same as the player represented by thisStructureOwner.booleanmatches(ICommandSender commandSender) Checks if a command sender is the same as the player represented by thisStructureOwner.Returns the value of thepermissionrecord component.Returns the value of theplayerDatarecord component.longReturns the value of thestructureUIDrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StructureOwner
Creates an instance of aStructureOwnerrecord class.- Parameters:
structureUID- the value for thestructureUIDrecord componentpermission- the value for thepermissionrecord componentplayerData- the value for theplayerDatarecord component
-
-
Method Details
-
matches
Checks if a command sender is the same as the player represented by thisStructureOwner.- Parameters:
commandSender- TheICommandSenderto check against.- Returns:
trueif the command sender is the same as the one represented by thisStructureOwner.
-
matches
Checks if a player is the same as the player represented by thisStructureOwner.- Parameters:
player- TheIPlayerto check against.- Returns:
trueif the player is the same as the one represented by thisStructureOwner.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
structureUID
public long structureUID()Returns the value of thestructureUIDrecord component.- Returns:
- the value of the
structureUIDrecord component
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
playerData
Returns the value of theplayerDatarecord component.- Returns:
- the value of the
playerDatarecord component
-