EspressoOptional

public final class EspressoOptional
extends Object

java.lang.Object
   ↳ androidx.test.espresso.util.EspressoOptional<T>


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

See also:

Summary

Public methods

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

Inherited methods

From class java.lang.Object

Public methods

absent

EspressoOptional<T> absent ()

Returns
EspressoOptional<T>

asSet

Set<T> asSet ()

Returns
Set<T>

equals

boolean equals (Object object)

Parameters
object Object

Returns
boolean

fromNullable

EspressoOptional<T> fromNullable (T nullableReference)

Parameters
nullableReference T

Returns
EspressoOptional<T>

get

T get ()

Returns
T

hashCode

int hashCode ()

Returns
int

isPresent

boolean isPresent ()

Returns
boolean

of

EspressoOptional<T> of (T reference)

Parameters
reference T

Returns
EspressoOptional<T>

or

T or (Supplier<? extends T> supplier)

Parameters
supplier Supplier

Returns
T

or

T or (T defaultValue)

Parameters
defaultValue T

Returns
T

or

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

Parameters
secondChoice Optional

Returns
Optional<T>

orNull

T orNull ()

Returns
T

presentInstances

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

Parameters
optionals Iterable

Returns
Iterable<T>

toString

String toString ()

Returns
String

transform

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

Parameters
function Function

Returns
Optional<V>