Enum Class Channel.Flag
- All Implemented Interfaces:
Serializable
,Comparable<Channel.Flag>
,Constable
- Enclosing interface:
- Channel
Represent channel flags : https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThisThreadChannel
is pinned to the top of its parentForumChannel
Whether a tag is required to be specified when creating aThreadChannel
in aForumChannel
. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the bit value associated to this flagint
Gets the shift amount associated to this bit valuestatic int
toBitfield
(EnumSet<Channel.Flag> flags) Translates anEnumSet<Channel.Flag>
to a binary bitfieldstatic EnumSet<Channel.Flag>
valueOf
(int bitfield) Translate a bitfield value into an< ForumChannelFlag >
related to known flagsstatic Channel.Flag
Returns the enum constant of this class with the specified name.static Channel.Flag[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PINNED
ThisThreadChannel
is pinned to the top of its parentForumChannel
-
REQUIRE_TAG
Whether a tag is required to be specified when creating aThreadChannel
in aForumChannel
. Tags are specified in the applied_tags field.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getShiftValue
public int getShiftValue()Gets the shift amount associated to this bit value- Returns:
- N in 1 << N that is the bit value for this flag
-
getBitValue
public int getBitValue()Gets the bit value associated to this flag- Returns:
- The bit field value associated to this flag
-
valueOf
Translate a bitfield value into an< ForumChannelFlag >
related to known flags- Parameters:
bitfield
- An integer representing the flags, one per bit- Returns:
- An
EnumSet<Channel.Flag>
of known flags associated to this bit field - Implementation Note:
- This implementation ignores unknown flags
-
toBitfield
Translates anEnumSet<Channel.Flag>
to a binary bitfield- Parameters:
flags
- Set of known forum channel flags- Returns:
- An integer representing the given set as an integer
-