## Uses of Class
com.google.common.base.Optional

Packages that use Optional
com.google.common.base: Basic utility libraries and interfaces.
com.google.common.collect: This package contains generic collection interfaces and implementations, and other utilities for working with collections.
com.google.common.net: This package contains utility methods and classes for working with net addresses (numeric IP and domain names).

Uses of Optional in com.google.common.base

Methods in com.google.common.base that return Optional

`static

`<T> Optional<T>`

`

`Optional.absent()`
Returns an `Optional` instance with no contained reference.

`static

`<T> Optional<T>`

`

`Optional.fromNullable(T nullableReference)`
If `nullableReference` is non-null, returns an `Optional` instance containing that reference; otherwise returns `absent()`.

`static

`<T extends Enum<T>> Optional<T>`

`

`Enums.getIfPresent(Class<T> enumClass, String value)`
Returns an optional enum constant for the given type, using `Enum.valueOf(java.lang.Class<T>, java.lang.String)`.

`static

`<T> Optional<T>`

`

`Optional.of(T reference)`
Returns an `Optional` instance containing the given non-null reference.

`abstract Optional<T>` `Optional.or(Optional<? extends T> secondChoice)` Returns this `Optional` if it has a value present; `secondChoice` otherwise.

`abstract

`<V> Optional<V>`

`

`Optional.transform(Function<? super T,V> function)`
If the instance is present, it is transformed with the given `Function`; otherwise, `absent()` is returned.

Methods in com.google.common.base with parameters of type Optional
`abstract Optional<T>` `Optional.or(Optional<? extends T> secondChoice)` Returns this `Optional` if it has a value present; `secondChoice` otherwise.

Method parameters in com.google.common.base with type arguments of type Optional

`static

`<T> Iterable<T>`

`

`Optional.presentInstances(Iterable<? extends Optional<? extends T>> optionals)`
Returns the value of each present instance from the supplied `optionals`, in order, skipping over occurrences of `absent()`.

Uses of Optional in com.google.common.collect

Methods in com.google.common.collect that return Optional
`Optional<E>` `FluentIterable.first()` Returns an `Optional` containing the first element in this fluent iterable.
`Optional<E>` `FluentIterable.firstMatch(Predicate<? super E> predicate)` Returns an `Optional` containing the first element in this fluent iterable that satisfies the given predicate, if such an element exists.
`Optional<E>` `FluentIterable.last()` Returns an `Optional` containing the last element in this fluent iterable.

`static

`<T> Optional<T>`

`

`Iterables.tryFind(Iterable<T> iterable, Predicate<? super T> predicate)`
Returns an `Optional` containing the first element in `iterable` that satisfies the given predicate, if such an element exists.

`static

`<T> Optional<T>`

`

`Iterators.tryFind(Iterator<T> iterator, Predicate<? super T> predicate)`
Returns an `Optional` containing the first element in `iterator` that satisfies the given predicate, if such an element exists.

Uses of Optional in com.google.common.net

Methods in com.google.common.net that return Optional
`Optional<Charset>` `MediaType.charset()` Returns an optional charset for the value of the charset parameter if it is specified.

Copyright © 2010-2012. All Rights Reserved.