Stay organized with collections Save and categorize content based on your preferences.

EspressoOptional

public final class EspressoOptional<T>


This class is a wrapper around com.google.common.base.Optional in order to avoid having public references to Guava API.

This is currently not recommended for use and will be deprecated in the future. New APIS should use Nullable annotation instead.

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 constructors

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<? extends T> secondChoice)
T
or(Supplier<? extends T> supplier)
T
static Iterable<T>
<T> presentInstances(Iterable<Optional<? extends T>> optionals)
String
Optional<V>
<V> transform(Function<? super T, V> function)

Public constructors

EspressoOptional

public EspressoOptional()

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<? extends T> secondChoice)

or

public T or(Supplier<? extends T> supplier)

orNull

public T orNull()

presentInstances

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

toString

public String toString()

transform

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