Interface Editor<T>

Type Parameters:
T - the type of the exported object
All Superinterfaces:
EditorAction
All Known Implementing Classes:
ListEditor, ValueEditor

public interface Editor<T> extends EditorAction
The Editor
  • Field Details

    • USAGE

      static final EditorString USAGE
      The string of the usage of the editor
    • INVALID_ACTION

      static final EditorString INVALID_ACTION
      The string of the message when the actor executes an invalid action
  • Method Details

    • actions

      Map<String,EditorAction> actions()
      The map of all available actions of the editor
      Returns:
      the action map
    • reset

      void reset()
      Reset the editor
    • status

      Object status()
      Get an object representing the status of the editor
      Returns:
      the status
    • export

      Optional<T> export(EditorActor actor)
      Export the object from the editor
      Parameters:
      actor - the actor
      Returns:
      the object if it's exported successfully, otherwise empty
    • migrate

      void migrate(T data)
      Migrate from the object
      Parameters:
      data - the object
    • description

      default EditorString description()
      Description copied from interface: EditorAction
      Get the description of the action
      Specified by:
      description in interface EditorAction
      Returns:
      the description
    • usage

      default EditorString usage()
      Description copied from interface: EditorAction
      Get the usage of the action
      Specified by:
      usage in interface EditorAction
      Returns:
      the usage
    • complete

      default Collection<String> complete(EditorActor actor, String[] args)
      Description copied from interface: EditorAction
      Get the completion suggestions, given the arguments
      Specified by:
      complete in interface EditorAction
      Parameters:
      actor - the action
      args - the argument
      Returns:
      the suggestions
    • execute

      default void execute(EditorActor actor, String[] args)
      Description copied from interface: EditorAction
      Execute the action
      Specified by:
      execute in interface EditorAction
      Parameters:
      actor - the actor
      args - the arguments