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()

This method is deprecated. Deprecated in Java

Set<T>

This method is deprecated. Deprecated in Java

boolean
equals(Object object)

This method is deprecated. Deprecated in Java

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

This method is deprecated. Deprecated in Java

T
get()

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

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

This method is deprecated. Deprecated in Java

T
or(T defaultValue)

This method is deprecated. Deprecated in Java

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

This method is deprecated. Deprecated in Java

T
or(Supplier<T> supplier)

This method is deprecated. Deprecated in Java

T

This method is deprecated. Deprecated in Java

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

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

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

This method is deprecated. Deprecated in Java

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)