public abstract class

Either

extends Object
java.lang.Object
   ↳ com.atlassian.upm.api.util.Either<L, R>

Class Overview

A disjoint union type typically used as an alternative to Option where by convention the left value contains an error and the right is akin to "some".

Summary

Nested Classes
class Either.LeftProjection<L, R>  
class Either.RightProjection<L, R>  
Public Methods
abstract <Z> Z fold(Function<L, Z> l, Function<R, Z> r)
static <L, R> Iterable<L> getLefts(Iterable<Either<L, R>> all)
static <L, R> Iterable<R> getRights(Iterable<Either<L, R>> all)
final boolean isLeft()
final boolean isRight()
final LeftProjection<L, R> left()
static <L, R> Either<L, R> left(L left)
final RightProjection<L, R> right()
static <L, R> Either<L, R> right(R right)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public abstract Z fold (Function<L, Z> l, Function<R, Z> r)

public static Iterable<L> getLefts (Iterable<Either<L, R>> all)

public static Iterable<R> getRights (Iterable<Either<L, R>> all)

public final boolean isLeft ()

public final boolean isRight ()

public final LeftProjection<L, R> left ()

public static Either<L, R> left (L left)

public final RightProjection<L, R> right ()

public static Either<L, R> right (R right)

Give us feedback

Was this documentation helpful?