Class PermissionsImpl
- java.lang.Object
-
- org.javacord.core.entity.permission.PermissionsImpl
-
- All Implemented Interfaces:
Permissions
public class PermissionsImpl extends Object implements Permissions
The implementation of the permissions interface.
-
-
Field Summary
Fields Modifier and Type Field Description static Permissions
EMPTY_PERMISSIONS
A permissions object with all permission types beingPermissionState.UNSET
.
-
Constructor Summary
Constructors Constructor Description PermissionsImpl(int allow)
Creates a new instance of this class.PermissionsImpl(int allow, int deny)
Creates a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getAllowedBitmask()
int
getDeniedBitmask()
PermissionState
getState(PermissionType type)
int
hashCode()
boolean
isEmpty()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javacord.api.entity.permission.Permissions
getAllowedPermission, getDeniedPermissions, getUnsetPermissions, toBuilder
-
-
-
-
Field Detail
-
EMPTY_PERMISSIONS
public static final Permissions EMPTY_PERMISSIONS
A permissions object with all permission types beingPermissionState.UNSET
.
-
-
Constructor Detail
-
PermissionsImpl
public PermissionsImpl(int allow, int deny)
Creates a new instance of this class.- Parameters:
allow
- An int containing all allowed permission types.deny
- An int containing all denied permission types.
-
PermissionsImpl
public PermissionsImpl(int allow)
Creates a new instance of this class.- Parameters:
allow
- An int containing all allowed permission types. Every other type will be set to denied.
-
-
Method Detail
-
getAllowedBitmask
public int getAllowedBitmask()
- Specified by:
getAllowedBitmask
in interfacePermissions
-
getDeniedBitmask
public int getDeniedBitmask()
- Specified by:
getDeniedBitmask
in interfacePermissions
-
getState
public PermissionState getState(PermissionType type)
- Specified by:
getState
in interfacePermissions
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePermissions
-
-