public enum Permission extends java.lang.Enum<Permission>
Modifier and Type | Field and Description |
---|---|
static long |
ALL_PERMISSIONS
Represents a raw set of all permissions
|
Modifier and Type | Method and Description |
---|---|
static Permission |
getFromOffset(int offset)
Gets the
Permission relating to the provided offset. |
java.lang.String |
getName()
The readable name as used in the Discord client.
|
int |
getOffset()
The binary offset of the permission.
|
static java.util.List<Permission> |
getPermissions(long permissions)
A list of all
Permissions that are specified by this raw long representation of
permissions. |
static long |
getRaw(java.util.Collection<Permission> permissions)
This is effectively the opposite of
getPermissions(long) , this takes a Collection of Permissions
and returns the raw offset long representation of the permissions. |
static long |
getRaw(Permission... permissions)
This is effectively the opposite of
getPermissions(long) , this takes 1 or more Permissions
and returns the raw offset long representation of the permissions. |
long |
getRawValue()
The value of this permission when viewed as a raw value.
|
boolean |
isChannel()
Returns whether or not this Permission is present Channel level
(configurable via
PermissionsOverrides ) |
boolean |
isGuild()
Returns whether or not this Permission is present at the Guild level
(configurable via
Roles ) |
static Permission |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Permission[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Permission CREATE_INSTANT_INVITE
public static final Permission KICK_MEMBERS
public static final Permission BAN_MEMBERS
public static final Permission ADMINISTRATOR
public static final Permission MANAGE_CHANNEL
public static final Permission MANAGE_SERVER
public static final Permission MESSAGE_ADD_REACTION
public static final Permission MESSAGE_READ
public static final Permission MESSAGE_WRITE
public static final Permission MESSAGE_TTS
public static final Permission MESSAGE_MANAGE
public static final Permission MESSAGE_EMBED_LINKS
public static final Permission MESSAGE_ATTACH_FILES
public static final Permission MESSAGE_HISTORY
public static final Permission MESSAGE_MENTION_EVERYONE
public static final Permission MESSAGE_EXT_EMOJI
public static final Permission VOICE_CONNECT
public static final Permission VOICE_SPEAK
public static final Permission VOICE_MUTE_OTHERS
public static final Permission VOICE_DEAF_OTHERS
public static final Permission VOICE_MOVE_OTHERS
public static final Permission VOICE_USE_VAD
public static final Permission NICKNAME_CHANGE
public static final Permission NICKNAME_MANAGE
public static final Permission MANAGE_ROLES
public static final Permission MANAGE_PERMISSIONS
public static final Permission MANAGE_WEBHOOKS
public static final Permission MANAGE_EMOTES
public static final Permission UNKNOWN
public static final long ALL_PERMISSIONS
public static Permission[] values()
for (Permission c : Permission.values()) System.out.println(c);
public static Permission valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getName()
Permission
.public int getOffset()
Permission
.public long getRawValue()
1 << getOffset()
public boolean isGuild()
Roles
)public boolean isChannel()
PermissionsOverrides
)public static Permission getFromOffset(int offset)
Permission
relating to the provided offset.
Permssions
that matches the provided
offset, Permission.UNKNOWN
is returned.offset
- The offset to match a Permission
to.Permission
relating to the provided offset.public static java.util.List<Permission> getPermissions(long permissions)
Permissions
that are specified by this raw long representation of
permissions. The is best used with the getRaw methods in Role
,
PermissionOverride
or PermissionUtil
.
Examples:
Role.getPermissionsRaw()
PermissionUtil.getEffectivePermission(Channel, Member)
permissions
- The raw long
representation of permissions.Permissions
.public static long getRaw(Permission... permissions)
getPermissions(long)
, this takes 1 or more Permissions
and returns the raw offset long
representation of the permissions.permissions
- The array of permissions of which to form into the raw long representation.public static long getRaw(java.util.Collection<Permission> permissions)
getPermissions(long)
, this takes a Collection of Permissions
and returns the raw offset long
representation of the permissions.permissions
- The Collection of permissions of which to form into the raw long representation.