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>

This method is deprecated. Deprecated in Java

boolean
equals(Object object)

This method is deprecated. Deprecated in Java

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

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 Optional<T>
<T> of(T value)

This method is deprecated. Deprecated in Java

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

This method is deprecated. Deprecated in Java

T
or(T other)

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

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

This method is deprecated. Deprecated in Java

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)