Record Class PermissionProvider
java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.permission.PermissionProvider
- All Implemented Interfaces:
Permission
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPermissionProvider(Group group, User user) Creates an instance of aPermissionProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getPermissions(int userId) Obtains the permissions of a user.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.booleanhasPermission(UUID uuid, String permission) Checks if a user has a permission.final StringtoString()Returns a string representation of this record class.user()Returns the value of theuserrecord component.
-
Field Details
-
group
The field for thegrouprecord component. -
user
The field for theuserrecord component.
-
-
Constructor Details
-
PermissionProvider
Creates an instance of aPermissionProviderrecord class.- Parameters:
group- the value for thegrouprecord componentuser- the value for theuserrecord component
-
-
Method Details
-
getPermissions
Description copied from interface:PermissionObtains the permissions of a user.- Specified by:
getPermissionsin interfacePermission- Parameters:
userId- The id of the user.- Returns:
- The permissions of the user.
-
hasPermission
Description copied from interface:PermissionChecks if a user has a permission.- Specified by:
hasPermissionin interfacePermission- Parameters:
uuid- The id of the player.permission- The permission.- Returns:
- True if the user has the permission, otherwise false.
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
user
Returns the value of theuserrecord component.- Returns:
- the value of the
userrecord component
-