Enum Class HandleResult

java.lang.Object
java.lang.Enum<HandleResult>
studio.mevera.imperat.context.internal.sur.HandleResult
All Implemented Interfaces:
Serializable, Comparable<HandleResult>, Constable

public enum HandleResult extends Enum<HandleResult>
Represents the result of a parameter handler execution, controlling chain flow with results per handler per iteration.
  • Enum Constant Details

    • TERMINATE

      public static final HandleResult TERMINATE
      Terminates the handler chain execution
    • NEXT_ITERATION

      public static final HandleResult NEXT_ITERATION
      Continues to the next iteration of the main loop
    • NEXT_HANDLER

      public static final HandleResult NEXT_HANDLER
      Proceeds to the next handler in the chain
    • FAILURE

      public static final HandleResult FAILURE
      Indicates an error occurred during handling
  • Method Details

    • values

      public static HandleResult[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HandleResult valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • failure

      public static HandleResult failure(ImperatException exception)
      Creates a failure result with the specified exception.
      Parameters:
      exception - the exception that caused the failure
      Returns:
      a FAILURE result containing the exception
    • getException

      @Nullable public @Nullable ImperatException getException()
      Gets the exception associated with this result.
      Returns:
      the exception if this is a FAILURE result, null otherwise