Class ClickEvent.Action<T extends ClickEvent.Payload>

java.lang.Object
net.kyori.adventure.text.event.ClickEvent.Action<T>
Type Parameters:
T - the payload type
Direct Known Subclasses:
ClickEvent.Action.ChangePage, ClickEvent.Action.Custom, ClickEvent.Action.ShowDialog, ClickEvent.Action.TextCarrier
Enclosing class:
ClickEvent<T extends ClickEvent.Payload>

public abstract static sealed class ClickEvent.Action<T extends ClickEvent.Payload> extends Object permits ClickEvent.Action.ChangePage, ClickEvent.Action.Custom, ClickEvent.Action.ShowDialog, ClickEvent.Action.TextCarrier
An enumeration of click event actions.

Note: although this interface is sealed, new implementations may be added at any time as and when needed.

Since:
4.0.0
  • Field Details

  • Method Details

    • readable

      public boolean readable()
      Tests if this action is readable.
      Returns:
      true if this action is readable, false if this action is not readable
      Since:
      4.0.0
    • supports

      public boolean supports(ClickEvent.Payload payload)
      Returns if this action supports the provided payload type.

      Note: This method only checks if the type of the payload is supported, to check if the payload is compatible with this action, see isValid(Payload).

      Parameters:
      payload - the payload
      Returns:
      true if this action supports the payload type
      Since:
      4.22.0
    • isValid

      public boolean isValid(T payload)
      Returns if the provided payload is valid for this action.
      Parameters:
      payload - the payload
      Returns:
      true if the payload is valid for this action, false otherwise
      Since:
      5.1.0
    • validate

      public void validate(T payload) throws IllegalArgumentException
      Validates the provided payload, throwing an exception if the payload is not valid for this action.
      Parameters:
      payload - the payload
      Throws:
      IllegalArgumentException - if the payload is not valid for this action
      Since:
      5.1.0
    • name

      public String name()
      Returns the name of this action.
      Returns:
      the name of the action
      Since:
      4.0.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object