EitherOf4

public final class EitherOf4<A extends Message, B extends Message, C extends Message, D extends Message> extends Either implements Element.AValue<T>, Element.BValue<T>, Element.CValue<T>, Element.DValue<T>

A value which can be one of four possible types.

Parameters

<A>

the type of the first alternative

<B>

the type of the second alternative

<C>

the type of the third alternative

<D>

the type of the fourth 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 C getC()
Obtains the value of the third alternative.
Link copied to clipboard
public D getD()
Obtains the value of the third alternative.
Link copied to clipboard
public static EitherOf4<A, B, C, D> withA<A extends Message, B extends Message, C extends Message, D extends Message>(A a)
Creates a new instance with <A> value.
Link copied to clipboard
public static EitherOf4<A, B, C, D> withB<A extends Message, B extends Message, C extends Message, D extends Message>(B b)
Creates a new instance with <B> value.
Link copied to clipboard
public static EitherOf4<A, B, C, D> withC<A extends Message, B extends Message, C extends Message, D extends Message>(C c)
Creates a new instance with <C> value.
Link copied to clipboard
public static EitherOf4<A, B, C, D> withD<A extends Message, B extends Message, C extends Message, D extends Message>(D d)
Creates a new instance with <C> 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.