EitherOf2

public final class EitherOf2<A extends Message, B extends Message> extends Either implements Element.AValue<T>, Element.BValue<T>

A value which can be one of two possible types.

Parameters

<A>

the type of the first alternative

<B>

the type of the second alternative

Functions

Link copied to clipboard
public A getA()
Obtains the value of the first alternative.
Link copied to clipboard
public B getB()
Obtains the value of the second alternative.
Link copied to clipboard
public static EitherOf2<A, B> withA<A extends Message, B extends Message>(A a)
Creates a new instance with <A> value.
Link copied to clipboard
public static EitherOf2<A, B> withB<A extends Message, B extends Message>(B b)
Creates a new instance with <B> value.

Inherited functions

Link copied to clipboard
public final boolean equals(Object obj)
Link copied to clipboard
public void forEach(Consumer<? extends Object> action)
Link copied to clipboard
protected static T get<T>(Either either, int index)
Link copied to clipboard
public final int hashCode()
Link copied to clipboard
protected final int index()
Obtains a zero-based index of the value.
Link copied to clipboard
public final Iterator<Message> iterator()
public abstract Iterator<T> iterator()
Link copied to clipboard
Link copied to clipboard
protected final Message value()
Obtains the stored value.