Package play.libs

Class F.Either<L,R>

java.lang.Object
play.libs.F.Either<L,R>
Enclosing class:
F

public static class F.Either<L,R> extends Object
Represents a value of one of two possible types (a disjoint union)
  • Field Details

    • left

      public final Optional<L> left
      The left value.
  • Method Details

    • Left

      public static <L, R> F.Either<L,R> Left(L value)
      Constructs a left side of the disjoint union, as opposed to the Right side.
      Type Parameters:
      L - the left type
      R - the right type
      Parameters:
      value - The value of the left side
      Returns:
      A left sided disjoint union
    • Right

      public static <L, R> F.Either<L,R> Right(R value)
      Constructs a right side of the disjoint union, as opposed to the Left side.
      Type Parameters:
      L - the left type
      R - the right type
      Parameters:
      value - The value of the right side
      Returns:
      A right sided disjoint union
    • toString

      public String toString()
      Overrides:
      toString in class Object