Class Either.Left<L,R>

java.lang.Object
io.github.resilience4j.core.functions.Either.Left<L,R>
Type Parameters:
L - left component type
R - right component type
All Implemented Interfaces:
Either<L,R>, Serializable
Enclosing interface:
Either<L,R>

public static final class Either.Left<L,R> extends Object implements Either<L,R>, Serializable
The Left version of an Either.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.github.resilience4j.core.functions.Either

    Either.Left<L,R>, Either.Right<L,R>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final L
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Left(L value)
    Constructs a Left.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Gets the right value if this is a Right or throws if this is a Left.
    Returns the left value.
    boolean
    Returns whether this Either is a Left.
    boolean
    Returns whether this Either is a Right.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.github.resilience4j.core.functions.Either

    fold, getOrNull, isEmpty, map, mapLeft, swap
  • Field Details

    • value

      private final L value
  • Constructor Details

    • Left

      private Left(L value)
      Constructs a Left.
      Parameters:
      value - a left value
  • Method Details

    • get

      public R get()
      Description copied from interface: Either
      Gets the right value if this is a Right or throws if this is a Left.
      Specified by:
      get in interface Either<L,R>
      Returns:
      the right value
    • getLeft

      public L getLeft()
      Description copied from interface: Either
      Returns the left value.
      Specified by:
      getLeft in interface Either<L,R>
      Returns:
      The left value.
    • isLeft

      public boolean isLeft()
      Description copied from interface: Either
      Returns whether this Either is a Left.
      Specified by:
      isLeft in interface Either<L,R>
      Returns:
      true, if this is a Left, false otherwise
    • isRight

      public boolean isRight()
      Description copied from interface: Either
      Returns whether this Either is a Right.
      Specified by:
      isRight in interface Either<L,R>
      Returns:
      true, if this is a Right, false otherwise