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

EspressoOptional

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 functions

java-static EspressoOptional<T!>!
<T> absent()
(Mutable)Set<T!>!
Boolean
equals(object: Any!)
java-static EspressoOptional<T!>!
<T> fromNullable(nullableReference: T!)
T!
get()
Int
Boolean
java-static EspressoOptional<T!>!
<T> of(reference: T!)
T!
or(defaultValue: T!)
Optional<T>!
or(secondChoice: Optional<? extends T>!)
T!
or(supplier: Supplier<? extends T>!)
T!
java-static (Mutable)Iterable<T!>!
<T> presentInstances(
    optionals: (Mutable)Iterable<Optional<? extends T>!>!
)
String!
Optional<V>!
<V> transform(function: Function<? super T, V>!)

Public constructors

EspressoOptional

EspressoOptional()

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<? extends T>!): Optional<T>!

or

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

orNull

fun orNull(): T!

presentInstances

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

toString

fun toString(): String!

transform

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