Enum Message.MentionType

java.lang.Object
java.lang.Enum<Message.MentionType>
net.dv8tion.jda.api.entities.Message.MentionType
All Implemented Interfaces:
Serializable, Comparable<Message.MentionType>
Enclosing interface:
Message

public static enum Message.MentionType extends Enum<Message.MentionType>
Mention constants, useful for use with Patterns
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Represents a mention for a TextChannel
    The first and only group matches the id of the mention.
    Represents a mention for a Emote
    The first group matches the name of the emote and the second the id of the mention.
    Represents a mention for all users in a server, literal @everyone.
    Represents a mention for all active users, literal @here
    Represents a mention for a Role
    The first and only group matches the id of the mention.
    Represents a mention for a User/Member
    The first and only group matches the id of the mention.
  • Method Summary

    Modifier and Type
    Method
    Description
    The Key returned by this method is used to determine the group or parsable mention group they are part of.
     
    Returns the enum constant of this type with the specified name.
    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 Details

    • USER

      public static final Message.MentionType USER
      Represents a mention for a User/Member
      The first and only group matches the id of the mention.
    • ROLE

      public static final Message.MentionType ROLE
      Represents a mention for a Role
      The first and only group matches the id of the mention.
    • CHANNEL

      public static final Message.MentionType CHANNEL
      Represents a mention for a TextChannel
      The first and only group matches the id of the mention.
    • EMOTE

      public static final Message.MentionType EMOTE
      Represents a mention for a Emote
      The first group matches the name of the emote and the second the id of the mention.
    • HERE

      public static final Message.MentionType HERE
      Represents a mention for all active users, literal @here
    • EVERYONE

      public static final Message.MentionType EVERYONE
      Represents a mention for all users in a server, literal @everyone.
  • Method Details

    • values

      public static Message.MentionType[] 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

      public static Message.MentionType valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getPattern

      @Nonnull public Pattern getPattern()
    • getParseKey

      @Nullable public String getParseKey()
      The Key returned by this method is used to determine the group or parsable mention group they are part of.
      It is used internally in methods like MessageAction#allowedMentions(Collection).

      Returns null, when they don't belong to any mention group.

      Returns:
      Nullable group key for mention parsing