Class ActionHandler<T extends ActionHandlerType<T,H>,H extends ActionHandler<T,H>>

java.lang.Object
org.mvplugins.multiverse.portals.action.ActionHandler<T,H>
Type Parameters:
T - The type of the action handler
H - The specific action handler class

@AvailableSince("5.2") public abstract class ActionHandler<T extends ActionHandlerType<T,H>,H extends ActionHandler<T,H>> extends Object
Represents an action handler that performs a specific action when an entity uses a portal.
Since:
5.2
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ActionHandler(T handlerType)
    Create a new action handler.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract @NotNull org.mvplugins.multiverse.core.locale.message.Message
    actionDescription(org.bukkit.entity.Entity entity)
    Get a description of the action for display purposes.
    Get the type of this action handler.
    abstract @NotNull org.mvplugins.multiverse.core.utils.result.Attempt<Void,ActionFailureReason>
    runAction(@NotNull MVPortal portal, @NotNull org.bukkit.entity.Entity entity)
    Run the action for the given portal and entity.
    abstract @NotNull String
    Serialise the action handler back into a string.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ActionHandler

      @AvailableSince("5.2") protected ActionHandler(@NotNull T handlerType)
      Create a new action handler.
      Parameters:
      handlerType - The type of this action handler
      Since:
      5.2
  • Method Details

    • getHandlerType

      @AvailableSince("5.2") @NotNull public T getHandlerType()
      Get the type of this action handler.
      Returns:
      The action handler type
      Since:
      5.2
    • runAction

      @AvailableSince("5.2") @NotNull public abstract @NotNull org.mvplugins.multiverse.core.utils.result.Attempt<Void,ActionFailureReason> runAction(@NotNull @NotNull MVPortal portal, @NotNull @NotNull org.bukkit.entity.Entity entity)
      Run the action for the given portal and entity.
      Parameters:
      portal - The portal being used
      entity - The entity using the portal
      Returns:
      An attempt indicating success or failure of the action
      Since:
      5.2
    • actionDescription

      @AvailableSince("5.2") @NotNull public abstract @NotNull org.mvplugins.multiverse.core.locale.message.Message actionDescription(org.bukkit.entity.Entity entity)
      Get a description of the action for display purposes.
      Parameters:
      entity - The entity to describe the action for
      Returns:
      The action description message
      Since:
      5.2
    • serialise

      @AvailableSince("5.2") @NotNull public abstract @NotNull String serialise()
      Serialise the action handler back into a string.
      Returns:
      The serialised action handler
      Since:
      5.2
    • toString

      public String toString()
      Overrides:
      toString in class Object