Enum Class Channel.Flag

java.lang.Object
java.lang.Enum<Channel.Flag>
discord4j.core.object.entity.channel.Channel.Flag
All Implemented Interfaces:
Serializable, Comparable<Channel.Flag>, Constable
Enclosing interface:
Channel

@Experimental public static enum Channel.Flag extends Enum<Channel.Flag>
  • Enum Constant Details

  • Method Details

    • values

      public static Channel.Flag[] 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

      public static Channel.Flag valueOf(String name)
      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 name
      NullPointerException - 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

      public static EnumSet<Channel.Flag> valueOf(int bitfield)
      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

      public static int toBitfield(EnumSet<Channel.Flag> flags)
      Translates an EnumSet<Channel.Flag> to a binary bitfield
      Parameters:
      flags - Set of known forum channel flags
      Returns:
      An integer representing the given set as an integer