Enum Message.MessageFlag

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Message.MessageFlag>
    Enclosing interface:
    Message

    public static enum Message.MessageFlag
    extends java.lang.Enum<Message.MessageFlag>
    Enum representing the flags on a Message.

    Note: The Values defined in this Enum are not considered final and only represent the current State of known Flags.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CROSSPOSTED
      The Message has been published to subscribed Channels (via Channel Following)
      EMBEDS_SUPPRESSED
      Embeds are suppressed on the Message.
      EPHEMERAL
      Indicates, that this Message is ephemeral, the Message is only visible to the bot and the interacting user
      IS_CROSSPOST
      The Message originated from a Message in another Channel (via Channel Following)
      LOADING
      Indicates, that this Message is an interaction response and the bot is "thinking"
      SOURCE_MESSAGE_DELETED
      Indicates, that the source message of this crosspost was deleted.
      URGENT
      Indicates, that this Message came from the urgent message system
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.EnumSet<Message.MessageFlag> fromBitField​(int bitfield)
      Given a bitfield, this function extracts all Enum values according to their bit values and returns an EnumSet containing all matching MessageFlags
      int getValue()
      Returns the value of the MessageFlag as represented in the bitfield.
      static int toBitField​(java.util.Collection<Message.MessageFlag> coll)
      Converts a Collection of MessageFlags back to the integer representing the bitfield.
      static Message.MessageFlag valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Message.MessageFlag[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CROSSPOSTED

        public static final Message.MessageFlag CROSSPOSTED
        The Message has been published to subscribed Channels (via Channel Following)
      • IS_CROSSPOST

        public static final Message.MessageFlag IS_CROSSPOST
        The Message originated from a Message in another Channel (via Channel Following)
      • SOURCE_MESSAGE_DELETED

        public static final Message.MessageFlag SOURCE_MESSAGE_DELETED
        Indicates, that the source message of this crosspost was deleted. This should only be possible in combination with IS_CROSSPOST
      • URGENT

        public static final Message.MessageFlag URGENT
        Indicates, that this Message came from the urgent message system
      • EPHEMERAL

        public static final Message.MessageFlag EPHEMERAL
        Indicates, that this Message is ephemeral, the Message is only visible to the bot and the interacting user
        See Also:
        Message.isEphemeral()
      • LOADING

        public static final Message.MessageFlag LOADING
        Indicates, that this Message is an interaction response and the bot is "thinking"
    • Method Detail

      • values

        public static Message.MessageFlag[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Message.MessageFlag c : Message.MessageFlag.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Message.MessageFlag valueOf​(java.lang.String name)
        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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public int getValue()
        Returns the value of the MessageFlag as represented in the bitfield. It is always a power of 2 (single bit)
        Returns:
        Non-Zero bit value of the field
      • fromBitField

        @Nonnull
        public static java.util.EnumSet<Message.MessageFlag> fromBitField​(int bitfield)
        Given a bitfield, this function extracts all Enum values according to their bit values and returns an EnumSet containing all matching MessageFlags
        Parameters:
        bitfield - Non-Negative integer representing a bitfield of MessageFlags
        Returns:
        Never-Null EnumSet of MessageFlags being found in the bitfield
      • toBitField

        public static int toBitField​(@Nonnull
                                     java.util.Collection<Message.MessageFlag> coll)
        Converts a Collection of MessageFlags back to the integer representing the bitfield. This is the reverse operation of fromBitField(int).
        Parameters:
        coll - A Non-Null Collection of MessageFlags
        Returns:
        Integer value of the bitfield representing the given MessageFlags
        Throws:
        java.lang.IllegalArgumentException - If the provided Collection is null