public class Optional<T> implements Serializable


Redefinition of Guava's Optional, created to avoid compatibilty breakages for users of EspressoOptional.

Summary

Public methods

Set<T>
boolean
equals(Object object)
static Optional<T>
<T> fromNullable(@Nullable T value)
T
get()
int
boolean
static Optional<T>
<T> of(T value)
Optional<T>
or(Optional<T> other)
T
or(T other)
T
or(Supplier<T> supplier)
T
static Iterable<T>
<T> presentInstances(Iterable<Optional<T>> optionals)
Optional<V>
<V> transform(Function<T, V> function)

Public methods

asSet

public Set<T> asSet()

equals

public boolean equals(Object object)

fromNullable

public static Optional<T> <T> fromNullable(@Nullable T value)

get

public T get()

hashCode

public int hashCode()

isPresent

public boolean isPresent()

of

public static Optional<T> <T> of(T value)

or

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

or

public T or(T other)

or

public T or(Supplier<T> supplier)

orNull

public T orNull()

presentInstances

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

transform

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