Class Either.Failure

All Implemented Interfaces:
Serializable
Enclosing interface:
Either<L,R>

public static class Either.Failure extends Exception
An exception wrapper used to propagate values through exception handling mechanisms.

This class wraps a value in an exception to enable using exception-based control flow when working with Either. It is not possible to use a generic type parameter for the exception type due to Java type system limitations.

See Also:
  • Field Details

  • Constructor Details

    • Failure

      public Failure(Object value)
      Constructs a new Failure wrapping the given value.
      Parameters:
      value - the value to wrap
  • Method Details

    • getValue

      public Object getValue()
      Returns the wrapped value.
      Returns:
      the wrapped value