Package play.libs

Class 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 Detail

      • left

        public final Optional<L> left
        The left value.
      • right

        public final Optional<R> right
        The right value.
    • Method Detail

      • 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