public final class EspressoOptional<T>


This class is a reimplementation of com.google.common.base.Optional to maintain API compatibility with older versions of espresso.

Parameters
<T>

the type of instance that can be contained. Optional is naturally covariant on this type, so it is safe to cast an Optional<T> to Optional<S> for any supertype S of T.

See also
Optional

Summary

Public methods

static EspressoOptional<T>
<T> absent()
Set<T>
boolean
equals(Object object)
static EspressoOptional<T>
<T> fromNullable(T nullableReference)
T
get()
int
boolean
static EspressoOptional<T>
<T> of(T reference)
T
or(T defaultValue)
Optional<T>
or(Optional<T> secondChoice)
T
or(Supplier<T> supplier)
T
static Iterable<T>
<T> presentInstances(Iterable<Optional<T>> optionals)
String
Optional<V>
<V> transform(Function<T, V> function)

Public methods

absent

public static EspressoOptional<T> <T> absent()

asSet

public Set<T> asSet()

equals

public boolean equals(Object object)

fromNullable

public static EspressoOptional<T> <T> fromNullable(T nullableReference)

get

public T get()

hashCode

public int hashCode()

isPresent

public boolean isPresent()

of

public static EspressoOptional<T> <T> of(T reference)

or

public T or(T defaultValue)

or

public Optional<T> or(Optional<T> secondChoice)

or

public T or(Supplier<T> supplier)

orNull

public T orNull()

presentInstances

public static Iterable<T> <T> presentInstances(Iterable<Optional<T>> optionals)

toString

public String toString()

transform

public Optional<V> <V> transform(Function<T, V> function)