Record Class PlayerData
java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.core.api.PlayerData
- Record Components:
uuid- The UUID of the player.name- The name of the player.limits- The limits of the player.isOp- Whether the player is an operator.hasProtectionBypassPermission- Whether the player has the permission to bypass protection.
public record PlayerData(UUID uuid, String name, LimitContainer limits, boolean isOp, boolean hasProtectionBypassPermission)
extends Record
Represents the data of a player.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerData(UUID uuid, String name, LimitContainer limits, boolean isOp, boolean hasProtectionBypassPermission) Creates an instance of aPlayerDatarecord class.PlayerData(UUID uuid, String name, LimitContainer limits, long permissionsFlag) Creates a newPlayerDatainstance with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringasString()Gets the player as a String in the format '"playerName" (playerUUID)'.final booleanIndicates whether some other object is "equal to" this one.Gets the limit for the specifiedLimit.getName()default longgetUUID()final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasProtectionBypassPermissionrecord component.booleanisOp()Returns the value of theisOprecord component.limits()Returns the value of thelimitsrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.uuid()Returns the value of theuuidrecord component.
-
Constructor Details
-
PlayerData
Creates a newPlayerDatainstance with the specified parameters.- Parameters:
uuid- The UUID of the player.name- The name of the player.limits- The limits of the player.permissionsFlag- The permissions flag of the player. SeeIPlayerDataContainer.PermissionFlag. This bit flag is used to setisOp()andhasProtectionBypassPermission()fromIPlayerDataContainer.PermissionFlag.OPandIPlayerDataContainer.PermissionFlag.BYPASSrespectively.
-
PlayerData
public PlayerData(UUID uuid, String name, LimitContainer limits, boolean isOp, boolean hasProtectionBypassPermission) Creates an instance of aPlayerDatarecord class.- Parameters:
uuid- the value for theuuidrecord componentname- the value for thenamerecord componentlimits- the value for thelimitsrecord componentisOp- the value for theisOprecord componenthasProtectionBypassPermission- the value for thehasProtectionBypassPermissionrecord component
-
-
Method Details
-
getLimit
Gets the limit for the specifiedLimit. -
getPlayerData
-
getName
-
getUUID
-
hasProtectionBypassPermission
public boolean hasProtectionBypassPermission()Returns the value of thehasProtectionBypassPermissionrecord component.- Returns:
- the value of the
hasProtectionBypassPermissionrecord component
-
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. -
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. -
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 '=='. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
limits
Returns the value of thelimitsrecord component.- Returns:
- the value of the
limitsrecord component
-
isOp
public boolean isOp()Returns the value of theisOprecord component.- Returns:
- the value of the
isOprecord component
-
asString
Gets the player as a String in the format '"playerName" (playerUUID)'.- Returns:
- The player as a String.
-
getPermissionsFlag
default long getPermissionsFlag()
-