Package net.dv8tion.jda.api.entities
Enum User.UserFlag
- All Implemented Interfaces:
Serializable
,Comparable<User.UserFlag>
- Enclosing interface:
- User
Represents the bit offsets used by Discord for public flags
-
Enum Constant Summary
Enum ConstantDescriptionUser is an Active DeveloperBot uses only HTTP interactions and is shown in the online member listUser is ateam
-
Field Summary
Modifier and TypeFieldDescriptionstatic final User.UserFlag[]
Empty array of UserFlag enum, useful for optimized use inCollection.toArray(Object[])
. -
Method Summary
Modifier and TypeMethodDescriptionstatic EnumSet<User.UserFlag>
getFlags
(int flags) A set of all UserFlags that are specified by this raw int representation of flags.static User.UserFlag
getFromOffset
(int offset) Gets the first UserFlag relating to the provided offset.getName()
The readable name as used in the Discord Client.int
The binary offset of the flag.static int
getRaw
(Collection<User.UserFlag> flags) This is effectively the opposite ofgetFlags(int)
.static int
getRaw
(User.UserFlag... flags) This is effectively the opposite ofgetFlags(int)
, this takes 1 or more UserFlags and returns the bitmask representation of the flags.int
The value of this flag when viewed as raw value.static User.UserFlag
Returns the enum constant of this type with the specified name.static User.UserFlag[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
STAFF
-
PARTNER
-
HYPESQUAD
-
BUG_HUNTER_LEVEL_1
-
HYPESQUAD_BRAVERY
-
HYPESQUAD_BRILLIANCE
-
HYPESQUAD_BALANCE
-
EARLY_SUPPORTER
-
TEAM_USER
User is ateam
-
BUG_HUNTER_LEVEL_2
-
VERIFIED_BOT
-
VERIFIED_DEVELOPER
-
CERTIFIED_MODERATOR
-
BOT_HTTP_INTERACTIONS
Bot uses only HTTP interactions and is shown in the online member list -
ACTIVE_DEVELOPER
User is an Active Developer -
UNKNOWN
-
-
Field Details
-
EMPTY_FLAGS
Empty array of UserFlag enum, useful for optimized use inCollection.toArray(Object[])
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
The readable name as used in the Discord Client.- Returns:
- The readable name of this UserFlag.
-
getOffset
public int getOffset()The binary offset of the flag.- Returns:
- The offset that represents this UserFlag.
-
getRawValue
public int getRawValue()The value of this flag when viewed as raw value.
This is equivalent to:1 <<
getOffset()
- Returns:
- The raw value of this specific flag.
-
getFromOffset
Gets the first UserFlag relating to the provided offset.
If there is no UserFlag that matches the provided offset,UNKNOWN
is returned.- Parameters:
offset
- The offset to match a UserFlag to.- Returns:
- UserFlag relating to the provided offset.
-
getFlags
A set of all UserFlags that are specified by this raw int representation of flags.- Parameters:
flags
- The rawint
representation if flags.- Returns:
- Possibly-empty EnumSet of UserFlags.
-
getRaw
This is effectively the opposite ofgetFlags(int)
, this takes 1 or more UserFlags and returns the bitmask representation of the flags.- Parameters:
flags
- The array of flags of which to form into the raw int representation.- Returns:
- bitmask representing the provided flags.
- Throws:
IllegalArgumentException
- When the provided UserFlags are null.
-
getRaw
This is effectively the opposite ofgetFlags(int)
. This takes a collection of UserFlags and returns the bitmask representation of the flags.
Example:getRaw(EnumSet.of(UserFlag.STAFF, UserFlag.HYPESQUAD))
- Parameters:
flags
- The flags to convert- Returns:
- bitmask representing the provided flags.
- Throws:
IllegalArgumentException
- When the provided UserFLags are null.- See Also:
-