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 functions

java-static EspressoOptional<T!>!
<T> absent()

This function is deprecated. Deprecated in Java

(Mutable)Set<T!>!

This function is deprecated. Deprecated in Java

Boolean
equals(object: Any!)

This function is deprecated. Deprecated in Java

java-static EspressoOptional<T!>!
<T> fromNullable(nullableReference: T!)

This function is deprecated. Deprecated in Java

T!
get()

This function is deprecated. Deprecated in Java

Int

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

java-static EspressoOptional<T!>!
<T> of(reference: T!)

This function is deprecated. Deprecated in Java

T!
or(defaultValue: T!)

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

T!
or(supplier: Supplier<T!>!)

This function is deprecated. Deprecated in Java

T!

This function is deprecated. Deprecated in Java

java-static (Mutable)Iterable<T!>!
<T> presentInstances(optionals: (Mutable)Iterable<Optional<T!>!>!)

This function is deprecated. Deprecated in Java

String!

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

Public functions

absent

java-static fun <T> absent(): EspressoOptional<T!>!

asSet

fun asSet(): (Mutable)Set<T!>!

equals

fun equals(object: Any!): Boolean

fromNullable

java-static fun <T> fromNullable(nullableReference: T!): EspressoOptional<T!>!

get

fun get(): T!

hashCode

fun hashCode(): Int

isPresent

fun isPresent(): Boolean

of

java-static fun <T> of(reference: T!): EspressoOptional<T!>!

or

fun or(defaultValue: T!): T!

or

fun or(secondChoice: Optional<T!>!): Optional<T!>!

or

fun or(supplier: Supplier<T!>!): T!

orNull

fun orNull(): T!

presentInstances

java-static fun <T> presentInstances(optionals: (Mutable)Iterable<Optional<T!>!>!): (Mutable)Iterable<T!>!

toString

fun toString(): String!

transform

fun <V> transform(function: Function<T!, V!>!): Optional<V!>!