Uses of Class
com.google.common.base.Optional
-
Packages that use Optional Package Description 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.graph An API for representing graph (node and edge) data.com.google.common.io This package contains utility methods and classes for working with Java I/O; for example input streams, output streams, readers, writers, and files.com.google.common.net This package contains utility methods and classes for working with net addresses (numeric IP and domain names).com.google.common.testing This package contains testing utilities.com.google.common.util.concurrent Concurrency utilities. -
-
Uses of Optional in com.google.common.base
Subclasses of Optional in com.google.common.base Modifier and Type Class Description (package private) classAbsent<T>Implementation of anOptionalnot containing a reference.(package private) classPresent<T>Implementation of anOptionalcontaining a reference.Methods in com.google.common.base that return Optional Modifier and Type Method Description static <T> Optional<T>Optional. absent()Returns anOptionalinstance with no contained reference.static <T> Optional<T>Optional. fromJavaUtil(java.util.Optional<T> javaUtilOptional)Returns the equivalentcom.google.common.base.Optionalvalue to the givenjava.util.Optional, ornullif the argument is null.static <T> Optional<T>Optional. fromNullable(T nullableReference)IfnullableReferenceis non-null, returns anOptionalinstance containing that reference; otherwise returnsabsent().(package private) static <T extends java.lang.Enum<T>>
Optional<T>Platform. getEnumIfPresent(java.lang.Class<T> enumClass, java.lang.String value)static <T extends java.lang.Enum<T>>
Optional<T>Enums. getIfPresent(java.lang.Class<T> enumClass, java.lang.String value)Returns an optional enum constant for the given type, usingEnum.valueOf(java.lang.Class<T>, java.lang.String).static <T> Optional<T>Optional. of(T reference)Returns anOptionalinstance containing the given non-null reference.Optional<T>Absent. or(Optional<? extends T> secondChoice)abstract Optional<T>Optional. or(Optional<? extends T> secondChoice)Returns thisOptionalif it has a value present;secondChoiceotherwise.Optional<T>Present. or(Optional<? extends T> secondChoice)<V> Optional<V>Absent. transform(Function<? super T,V> function)abstract <V> Optional<V>Optional. transform(Function<? super T,V> function)<V> Optional<V>Present. transform(Function<? super T,V> function)(package private) static <T> Optional<T>Absent. withType()Methods in com.google.common.base with parameters of type Optional Modifier and Type Method Description Optional<T>Absent. or(Optional<? extends T> secondChoice)abstract Optional<T>Optional. or(Optional<? extends T> secondChoice)Returns thisOptionalif it has a value present;secondChoiceotherwise.Optional<T>Present. or(Optional<? extends T> secondChoice)static <T> java.util.Optional<T>Optional. toJavaUtil(Optional<T> googleOptional)Returns the equivalentjava.util.Optionalvalue to the givencom.google.common.base.Optional, ornullif the argument is null.Method parameters in com.google.common.base with type arguments of type Optional Modifier and Type Method Description static <T> java.lang.Iterable<T>Optional. presentInstances(java.lang.Iterable<? extends Optional<? extends T>> optionals)Returns the value of each present instance from the suppliedoptionals, in order, skipping over occurrences ofabsent(). -
Uses of Optional in com.google.common.collect
Fields in com.google.common.collect declared as Optional Modifier and Type Field Description private Optional<java.lang.Iterable<E>>FluentIterable. iterableDelegateMethods in com.google.common.collect that return Optional Modifier and Type Method Description Optional<E>FluentIterable. first()Returns anOptionalcontaining the first element in this fluent iterable.Optional<E>FluentIterable. firstMatch(Predicate<? super E> predicate)Returns anOptionalcontaining the first element in this fluent iterable that satisfies the given predicate, if such an element exists.Optional<E>FluentIterable. last()Returns anOptionalcontaining the last element in this fluent iterable.static <T> Optional<T>Iterables. tryFind(java.lang.Iterable<T> iterable, Predicate<? super T> predicate)Returns anOptionalcontaining the first element initerablethat satisfies the given predicate, if such an element exists.static <T> Optional<T>Iterators. tryFind(java.util.Iterator<T> iterator, Predicate<? super T> predicate)Returns anOptionalcontaining the first element initeratorthat satisfies the given predicate, if such an element exists.Methods in com.google.common.collect with parameters of type Optional Modifier and Type Method Description static <T> java.util.stream.Stream<T>Streams. stream(Optional<T> optional)If a value is present inoptional, returns a stream containing only that element, otherwise returns an empty stream. -
Uses of Optional in com.google.common.graph
Fields in com.google.common.graph declared as Optional Modifier and Type Field Description (package private) Optional<java.lang.Integer>NetworkBuilder. expectedEdgeCount(package private) Optional<java.lang.Integer>AbstractGraphBuilder. expectedNodeCount -
Uses of Optional in com.google.common.io
Methods in com.google.common.io that return Optional Modifier and Type Method Description Optional<java.lang.Long>CharSource.CharSequenceCharSource. lengthIfKnown()Optional<java.lang.Long>CharSource.ConcatenatedCharSource. lengthIfKnown()Optional<java.lang.Long>CharSource. lengthIfKnown()Returns the size of this source in chars, if the size can be easily determined without actually opening the data stream.Optional<java.lang.Long>ByteSource.ByteArrayByteSource. sizeIfKnown()Optional<java.lang.Long>ByteSource.ConcatenatedByteSource. sizeIfKnown()Optional<java.lang.Long>ByteSource. sizeIfKnown()Returns the size of this source in bytes, if the size can be easily determined without actually opening the data stream.Optional<java.lang.Long>ByteSource.SlicedByteSource. sizeIfKnown()Optional<java.lang.Long>Files.FileByteSource. sizeIfKnown()Optional<java.lang.Long>MoreFiles.PathByteSource. sizeIfKnown() -
Uses of Optional in com.google.common.net
Fields in com.google.common.net declared as Optional Modifier and Type Field Description private Optional<java.nio.charset.Charset>MediaType. parsedCharsetMethods in com.google.common.net that return Optional Modifier and Type Method Description Optional<java.nio.charset.Charset>MediaType. charset()Returns an optional charset for the value of the charset parameter if it is specified.Methods in com.google.common.net with parameters of type Optional Modifier and Type Method Description private intInternetDomainName. findSuffixOfType(Optional<PublicSuffixType> desiredType)Returns the index of the leftmost part of the suffix, or -1 if not found.private static booleanInternetDomainName. matchesType(Optional<PublicSuffixType> desiredType, Optional<PublicSuffixType> actualType)If adesiredTypeis specified, returns true only if theactualTypeis identical.private static booleanInternetDomainName. matchesWildcardSuffixType(Optional<PublicSuffixType> desiredType, java.lang.String domain)Does the domain name match one of the "wildcard" patterns (e.g. -
Uses of Optional in com.google.common.testing
Methods in com.google.common.testing that return Optional Modifier and Type Method Description (package private) abstract Optional<java.lang.String>AbstractPackageSanityTests.Chopper. chop(java.lang.String str)private <T> Optional<T>FreshValueGenerator. generateGoogleOptional()private <T> Optional<T>FreshValueGenerator. generateGoogleOptional(T value) -
Uses of Optional in com.google.common.util.concurrent
Fields in com.google.common.util.concurrent with type parameters of type Optional Modifier and Type Field Description private java.util.List<Optional<V>>CollectionFuture.CollectionFutureRunningState. valuesMethod parameters in com.google.common.util.concurrent with type arguments of type Optional Modifier and Type Method Description (package private) abstract CCollectionFuture.CollectionFutureRunningState. combine(java.util.List<Optional<V>> values)java.util.List<V>CollectionFuture.ListFuture.ListFutureRunningState. combine(java.util.List<Optional<V>> values)
-