Class ClickActionAdapter
java.lang.Object
me.remigio07.chatplugin.api.common.util.adapter.text.ClickActionAdapter
Represents an action performed on a click event.
This class is a pseudo-Enum. It contains the following methods:
name(), ordinal(), valueOf(String) and values().
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClickActionAdapterCopies text to the player's clipboard.static final ClickActionAdapterOpens the URL in the player's browser.static final ClickActionAdapterMakes the player send a message.static final ClickActionAdapterSuggests text in the player's chat. -
Method Summary
Modifier and TypeMethodDescriptiongetID()Gets this action's ID.booleanChecks if this click action is supported onVersionUtils.getVersion().name()Equivalent ofEnum.name().intordinal()Equivalent ofEnum.ordinal().static ClickActionAdapterEquivalent ofEnum#valueOf(String), with the only difference that instead of throwingIllegalArgumentExceptionnullis returned if the constant's name is invalid.static ClickActionAdapter[]values()Equivalent ofEnum#values().
-
Field Details
-
COPY_TEXT
Copies text to the player's clipboard.Minimum version: 1.15.2
-
OPEN_URL
Opens the URL in the player's browser. -
SEND_MESSAGE
Makes the player send a message. -
SUGGEST_TEXT
Suggests text in the player's chat.
-
-
Method Details
-
name
Equivalent ofEnum.name().- Returns:
- Constant's name
-
ordinal
public int ordinal()Equivalent ofEnum.ordinal().- Returns:
- Constant's ordinal
-
getID
Gets this action's ID.- Returns:
- Action's ID
-
isSupported
public boolean isSupported()Checks if this click action is supported onVersionUtils.getVersion().- Returns:
- Whether this click action is supported
-
valueOf
Equivalent ofEnum#valueOf(String), with the only difference that instead of throwingIllegalArgumentExceptionnullis returned if the constant's name is invalid.This method recognizes Bukkit's, Sponge's, BungeeCord's and Velocity's IDs.
- Parameters:
name- Constant's name- Returns:
- Enum constant
-
values
Equivalent ofEnum#values().- Returns:
- Enum constants
-