Package net.dv8tion.jda.api.entities
Enum Message.MentionType
- java.lang.Object
-
- java.lang.Enum<Message.MentionType>
-
- net.dv8tion.jda.api.entities.Message.MentionType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Message.MentionType>
- Enclosing interface:
- Message
public static enum Message.MentionType extends java.lang.Enum<Message.MentionType>
Mention constants, useful for use withPatterns
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CHANNEL
Represents a mention for aTextChannel
The first and only group matches the id of the mention.EMOTE
Represents a mention for aEmote
The first group matches the name of the emote and the second the id of the mention.EVERYONE
Represents a mention for all users in a server, literal@everyone
.HERE
Represents a mention for all active users, literal@here
ROLE
Represents a mention for aRole
The first and only group matches the id of the mention.USER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getParseKey()
The Key returned by this method is used to determine the group or parsable mention group they are part of.java.util.regex.Pattern
getPattern()
static Message.MentionType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Message.MentionType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
USER
public static final Message.MentionType USER
-
ROLE
public static final Message.MentionType ROLE
Represents a mention for aRole
The first and only group matches the id of the mention.
-
CHANNEL
public static final Message.MentionType CHANNEL
Represents a mention for aTextChannel
The first and only group matches the id of the mention.
-
EMOTE
public static final Message.MentionType EMOTE
Represents a mention for aEmote
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 Detail
-
values
public static Message.MentionType[] 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.MentionType c : Message.MentionType.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.MentionType 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 namejava.lang.NullPointerException
- if the argument is null
-
getPattern
@Nonnull public java.util.regex.Pattern getPattern()
-
getParseKey
@Nullable public java.lang.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 likeMessageAction#allowedMentions(Collection)
.Returns
null
, when they don't belong to any mention group.- Returns:
- Nullable group key for mention parsing
-
-