Uses of Interface
com.google.common.base.Function
-
Packages that use Function Package Description com.google.common.base Basic utility libraries and interfaces.com.google.common.cache This package contains caching utilities.com.google.common.collect This package contains generic collection interfaces and implementations, and other utilities for working with collections.com.google.common.escape Interfaces, utilities, and simple implementations of escapers and encoders.com.google.common.graph An API for representing graph (node and edge) data.com.google.common.primitives Static utilities for working with the eight primitive types andvoid, and value types for treating them as unsigned.com.google.common.reflect This package contains utilities to work with Java reflection.com.google.common.testing This package contains testing utilities.com.google.common.util.concurrent Concurrency utilities. -
-
Uses of Function in com.google.common.base
Subinterfaces of Function in com.google.common.base Modifier and Type Interface Description private static interfaceSuppliers.SupplierFunction<T>Classes in com.google.common.base that implement Function Modifier and Type Class Description private static classCaseFormat.StringConverterclassConverter<A,B>A function fromAtoBwith an associated reverse function fromBtoA; used for converting back and forth between different representations of the same information.private static classConverter.ConverterComposition<A,B,C>private static classConverter.FunctionBasedConverter<A,B>private static classConverter.IdentityConverter<T>A converter that always converts or reverses an object to itself.private static classConverter.ReverseConverter<A,B>private static classEnums.StringConverter<T extends java.lang.Enum<T>>private static classFunctions.ConstantFunction<E>private static classFunctions.ForMapWithDefault<K,V>private static classFunctions.FunctionComposition<A,B,C>private static classFunctions.FunctionForMapNoDefault<K,V>private static classFunctions.IdentityFunctionprivate static classFunctions.PredicateFunction<T>private static classFunctions.SupplierFunction<T>private static classFunctions.ToStringFunctionprivate static classSuppliers.SupplierFunctionImplFields in com.google.common.base declared as Function Modifier and Type Field Description private Function<? super B,? extends A>Converter.FunctionBasedConverter. backwardFunctionprivate Function<A,? extends B>Functions.FunctionComposition. f(package private) Function<A,? extends B>Predicates.CompositionPredicate. fprivate Function<? super A,? extends B>Converter.FunctionBasedConverter. forwardFunctionprivate Function<F,? extends T>FunctionalEquivalence. function(package private) Function<? super F,T>Suppliers.SupplierComposition. functionprivate Function<B,C>Functions.FunctionComposition. gMethods in com.google.common.base that return Function Modifier and Type Method Description static <A,B,C>
Function<A,C>Functions. compose(Function<B,C> g, Function<A,? extends B> f)Returns the composition of two functions.static <E> Function<java.lang.Object,E>Functions. constant(E value)Returns a function that ignores its input and always returnsvalue.static <K,V>
Function<K,V>Functions. forMap(java.util.Map<K,? extends V> map, V defaultValue)Returns a function which performs a map lookup with a default value.static <K,V>
Function<K,V>Functions. forMap(java.util.Map<K,V> map)Returns a function which performs a map lookup.static <T> Function<T,java.lang.Boolean>Functions. forPredicate(Predicate<T> predicate)Creates a function that returns the same boolean output as the given predicate for all inputs.static <T> Function<java.lang.Object,T>Functions. forSupplier(Supplier<T> supplier)Returns a function that ignores its input and returns the result ofsupplier.get().static <E> Function<E,E>Functions. identity()Returns the identity function.static <T> Function<Supplier<T>,T>Suppliers. supplierFunction()Returns a function that accepts a supplier and returns the result of invokingSupplier.get()on that supplier.static Function<java.lang.Object,java.lang.String>Functions. toStringFunction()A function equivalent to the method referenceObject::toString, for users not yet using Java 8.Methods in com.google.common.base with parameters of type Function Modifier and Type Method Description static <A,B,C>
Function<A,C>Functions. compose(Function<B,C> g, Function<A,? extends B> f)Returns the composition of two functions.static <A,B>
Predicate<A>Predicates. compose(Predicate<B> predicate, Function<A,? extends B> function)Returns the composition of a function and a predicate.static <F,T>
Supplier<T>Suppliers. compose(Function<? super F,T> function, Supplier<F> supplier)Returns a new supplier which is the composition of the provided function and supplier.static <A,B>
Converter<A,B>Converter. from(Function<? super A,? extends B> forwardFunction, Function<? super B,? extends A> backwardFunction)Returns a converter based on separate forward and backward functions.<F> Equivalence<F>Equivalence. onResultOf(Function<F,? extends T> function)Returns a new equivalence relation forFwhich evaluates equivalence by first applyingfunctionto the argument, then evaluating usingthis.<V> Optional<V>Absent. transform(Function<? super T,V> function)abstract <V> Optional<V>Optional. transform(Function<? super T,V> function)If the instance is present, it is transformed with the givenFunction; otherwise,Optional.absent()is returned.<V> Optional<V>Present. transform(Function<? super T,V> function)Constructors in com.google.common.base with parameters of type Function Constructor Description CompositionPredicate(Predicate<B> p, Function<A,? extends B> f)FunctionalEquivalence(Function<F,? extends T> function, Equivalence<T> resultEquivalence)FunctionBasedConverter(Function<? super A,? extends B> forwardFunction, Function<? super B,? extends A> backwardFunction)FunctionComposition(Function<B,C> g, Function<A,? extends B> f)SupplierComposition(Function<? super F,T> function, Supplier<F> supplier) -
Uses of Function in com.google.common.cache
Subinterfaces of Function in com.google.common.cache Modifier and Type Interface Description interfaceLoadingCache<K,V>A semi-persistent mapping from keys to values.Classes in com.google.common.cache that implement Function Modifier and Type Class Description classAbstractLoadingCache<K,V>This class provides a skeletal implementation of theCacheinterface to minimize the effort required to implement this interface.classForwardingLoadingCache<K,V>A cache which forwards all its method calls to another cache.static classForwardingLoadingCache.SimpleForwardingLoadingCache<K,V>A simplified version ofForwardingLoadingCachewhere subclasses can pass in an already constructedLoadingCacheas the delegate.(package private) static classLocalCache.LoadingSerializationProxy<K,V>Serializes the configuration of a LocalCache, reconstituting it as an LoadingCache using CacheBuilder upon deserialization.(package private) static classLocalCache.LocalLoadingCache<K,V>Fields in com.google.common.cache declared as Function Modifier and Type Field Description private Function<K,V>CacheLoader.FunctionToCacheLoader. computingFunctionMethods in com.google.common.cache with parameters of type Function Modifier and Type Method Description static <K,V>
CacheLoader<K,V>CacheLoader. from(Function<K,V> function)Returns a cache loader that usesfunctionto load keys, without supporting either reloading or bulk loading.Constructors in com.google.common.cache with parameters of type Function Constructor Description FunctionToCacheLoader(Function<K,V> computingFunction) -
Uses of Function in com.google.common.collect
Classes in com.google.common.collect that implement Function Modifier and Type Class Description private static classFluentIterable.FromIterableFunction<E>Function that transformsIterable<E>into a fluent iterable.private static classInterners.InternerFunction<E>private static classMaps.BiMapConverter<A,B>private static classMaps.EntryFunction(package private) static classRange.LowerBoundFn(package private) static classRange.UpperBoundFnFields in com.google.common.collect declared as Function Modifier and Type Field Description (package private) Function<F,? extends T>ByFunctionOrdering. function(package private) Function<? super F,? extends T>Collections2.TransformedCollection. function(package private) Function<? super F,? extends T>Lists.TransformingRandomAccessList. function(package private) Function<? super F,? extends T>Lists.TransformingSequentialList. function(package private) Function<? super K,V>Maps.AsMapView. functionprivate Function<? super K,V>Maps.NavigableAsMapView. function(package private) Function<? super V1,V2>Tables.TransformedTable. functionprivate static Function<Table.Cell<?,?,?>,Table.Cell<?,?,?>>Tables.TransposeTable. TRANSPOSE_CELLprivate static Function<? extends java.util.Map<?,?>,? extends java.util.Map<?,?>>Tables. UNMODIFIABLE_WRAPPERMethods in com.google.common.collect that return Function Modifier and Type Method Description (package private) static <K,V1,V2>
Function<java.util.Map.Entry<K,V1>,java.util.Map.Entry<K,V2>>Maps. asEntryToEntryFunction(Maps.EntryTransformer<? super K,? super V1,V2> transformer)Views an entry transformer as a function from entries to entries.(package private) static <K,V1,V2>
Function<java.util.Map.Entry<K,V1>,V2>Maps. asEntryToValueFunction(Maps.EntryTransformer<? super K,? super V1,V2> transformer)Views an entry transformer as a function fromEntryto values.static <E> Function<E,E>Interners. asFunction(Interner<E> interner)Returns a function that delegates to theInterner.intern(E)method of the given interner.(package private) static <K,V1,V2>
Function<V1,V2>Maps. asValueToValueFunction(Maps.EntryTransformer<? super K,V1,V2> transformer, K key)(package private) Function<Table.Cell<R,C,V1>,Table.Cell<R,C,V2>>Tables.TransformedTable. cellFunction()(package private) static <K> Function<java.util.Map.Entry<K,?>,K>Maps. keyFunction()(package private) static <C extends java.lang.Comparable<?>>
Function<Range<C>,Cut<C>>Range. lowerBoundFn()(package private) static <T> Function<java.lang.Iterable<? extends T>,java.util.Iterator<? extends T>>Iterables. toIterator()private static <K,V>
Function<java.util.Map<K,V>,java.util.Map<K,V>>Tables. unmodifiableWrapper()(package private) static <C extends java.lang.Comparable<?>>
Function<Range<C>,Cut<C>>Range. upperBoundFn()(package private) static <V> Function<java.util.Map.Entry<?,V>,V>Maps. valueFunction()Methods in com.google.common.collect with parameters of type Function Modifier and Type Method Description (package private) static <K,V1,V2>
Maps.EntryTransformer<K,V1,V2>Maps. asEntryTransformer(Function<? super V1,V2> function)Views a function as an entry transformer that ignores the entry key.static <K,V>
java.util.NavigableMap<K,V>Maps. asMap(java.util.NavigableSet<K> set, Function<? super K,V> function)Returns a view of the navigable set as a map, mapping keys from the set according to the specified function.static <K,V>
java.util.Map<K,V>Maps. asMap(java.util.Set<K> set, Function<? super K,V> function)Returns a liveMapview whose keys are the contents ofsetand whose values are computed on demand usingfunction.static <K,V>
java.util.SortedMap<K,V>Maps. asMap(java.util.SortedSet<K> set, Function<? super K,V> function)Returns a view of the sorted set as a map, mapping keys from the set according to the specified function.(package private) static <K,V>
java.util.Iterator<java.util.Map.Entry<K,V>>Maps. asMapEntryIterator(java.util.Set<K> set, Function<? super K,V> function)static <E,K extends java.lang.Comparable>
intSortedLists. binarySearch(java.util.List<E> list, Function<? super E,K> keyFunction, K key, SortedLists.KeyPresentBehavior presentBehavior, SortedLists.KeyAbsentBehavior absentBehavior)Binary searches the list for the specified key, using the specified key function.static <E,K>
intSortedLists. binarySearch(java.util.List<E> list, Function<? super E,K> keyFunction, K key, java.util.Comparator<? super K> keyComparator, SortedLists.KeyPresentBehavior presentBehavior, SortedLists.KeyAbsentBehavior absentBehavior)Binary searches the list for the specified key, using the specified key function.<K> ImmutableListMultimap<K,E>FluentIterable. index(Function<? super E,K> keyFunction)Creates an indexImmutableListMultimapthat contains the results of applying a specified function to each item in thisFluentIterableof values.static <K,V>
ImmutableListMultimap<K,V>Multimaps. index(java.lang.Iterable<V> values, Function<? super V,K> keyFunction)Creates an indexImmutableListMultimapthat contains the results of applying a specified function to each item in anIterableof values.static <K,V>
ImmutableListMultimap<K,V>Multimaps. index(java.util.Iterator<V> values, Function<? super V,K> keyFunction)Creates an indexImmutableListMultimapthat contains the results of applying a specified function to each item in anIteratorof values.<F> Ordering<F>Ordering. onResultOf(Function<F,? extends T> function)Returns a new ordering onFwhich orders elements by first applying a function to them, then comparing those results usingthis.<V> ImmutableMap<E,V>FluentIterable. toMap(Function<? super E,V> valueFunction)Returns an immutable map whose keys are the distinct elements of thisFluentIterableand whose value for each key was computed byvalueFunction.static <K,V>
ImmutableMap<K,V>Maps. toMap(java.lang.Iterable<K> keys, Function<? super K,V> valueFunction)Returns an immutable map whose keys are the distinct elements ofkeysand whose value for each key was computed byvalueFunction.static <K,V>
ImmutableMap<K,V>Maps. toMap(java.util.Iterator<K> keys, Function<? super K,V> valueFunction)Returns an immutable map whose keys are the distinct elements ofkeysand whose value for each key was computed byvalueFunction.static <F,T>
java.util.Collection<T>Collections2. transform(java.util.Collection<F> fromCollection, Function<? super F,T> function)Returns a collection that appliesfunctionto each element offromCollection.<T> FluentIterable<T>FluentIterable. transform(Function<? super E,T> function)Returns a fluent iterable that appliesfunctionto each element of this fluent iterable.static <F,T>
java.lang.Iterable<T>Iterables. transform(java.lang.Iterable<F> fromIterable, Function<? super F,? extends T> function)Returns a view containing the result of applyingfunctionto each element offromIterable.static <F,T>
java.util.Iterator<T>Iterators. transform(java.util.Iterator<F> fromIterator, Function<? super F,? extends T> function)Returns a view containing the result of applyingfunctionto each element offromIterator.static <F,T>
java.util.List<T>Lists. transform(java.util.List<F> fromList, Function<? super F,? extends T> function)Returns a list that appliesfunctionto each element offromList.<T> FluentIterable<T>FluentIterable. transformAndConcat(Function<? super E,? extends java.lang.Iterable<? extends T>> function)Appliesfunctionto each element of this fluent iterable and returns a fluent iterable with the concatenated combination of results.static <K,V1,V2>
java.util.Map<K,V2>Maps. transformValues(java.util.Map<K,V1> fromMap, Function<? super V1,V2> function)Returns a view of a map where each value is transformed by a function.static <K,V1,V2>
java.util.NavigableMap<K,V2>Maps. transformValues(java.util.NavigableMap<K,V1> fromMap, Function<? super V1,V2> function)Returns a view of a navigable map where each value is transformed by a function.static <K,V1,V2>
java.util.SortedMap<K,V2>Maps. transformValues(java.util.SortedMap<K,V1> fromMap, Function<? super V1,V2> function)Returns a view of a sorted map where each value is transformed by a function.static <K,V1,V2>
ListMultimap<K,V2>Multimaps. transformValues(ListMultimap<K,V1> fromMultimap, Function<? super V1,V2> function)Returns a view of aListMultimapwhere each value is transformed by a function.static <K,V1,V2>
Multimap<K,V2>Multimaps. transformValues(Multimap<K,V1> fromMultimap, Function<? super V1,V2> function)Returns a view of a multimap where each value is transformed by a function.static <R,C,V1,V2>
Table<R,C,V2>Tables. transformValues(Table<R,C,V1> fromTable, Function<? super V1,V2> function)Returns a view of a table where each value is transformed by a function.<K> ImmutableMap<K,E>FluentIterable. uniqueIndex(Function<? super E,K> keyFunction)Returns a map with the contents of thisFluentIterableas itsvalues, indexed by keys derived from those values.static <K,V>
ImmutableMap<K,V>Maps. uniqueIndex(java.lang.Iterable<V> values, Function<? super V,K> keyFunction)Returns a map with the givenvalues, indexed by keys derived from those values.static <K,V>
ImmutableMap<K,V>Maps. uniqueIndex(java.util.Iterator<V> values, Function<? super V,K> keyFunction)Returns a map with the givenvalues, indexed by keys derived from those values.static <T> TreeTraverser<T>TreeTraverser. using(Function<T,? extends java.lang.Iterable<T>> nodeToChildrenFunction)Deprecated.Constructors in com.google.common.collect with parameters of type Function Constructor Description AsMapView(java.util.Set<K> set, Function<? super K,V> function)ByFunctionOrdering(Function<F,? extends T> function, Ordering<T> ordering)NavigableAsMapView(java.util.NavigableSet<K> ks, Function<? super K,V> vFunction)SortedAsMapView(java.util.SortedSet<K> set, Function<? super K,V> function)TransformedCollection(java.util.Collection<F> fromCollection, Function<? super F,? extends T> function)TransformedTable(Table<R,C,V1> fromTable, Function<? super V1,V2> function)TransformingRandomAccessList(java.util.List<F> fromList, Function<? super F,? extends T> function)TransformingSequentialList(java.util.List<F> fromList, Function<? super F,? extends T> function) -
Uses of Function in com.google.common.escape
Fields in com.google.common.escape declared as Function Modifier and Type Field Description private Function<java.lang.String,java.lang.String>Escaper. asFunctionMethods in com.google.common.escape that return Function Modifier and Type Method Description Function<java.lang.String,java.lang.String>Escaper. asFunction()Returns aFunctionthat invokesEscaper.escape(String)on this escaper. -
Uses of Function in com.google.common.graph
Methods in com.google.common.graph that return Function Modifier and Type Method Description private static <N,E>
Function<E,N>ImmutableNetwork. adjacentNodeFn(Network<N,E> network, N node)private static <N,E>
Function<E,N>ImmutableNetwork. sourceNodeFn(Network<N,E> network)private static <N,E>
Function<E,N>ImmutableNetwork. targetNodeFn(Network<N,E> network)Methods in com.google.common.graph with parameters of type Function Modifier and Type Method Description (package private) static <N,V>
DirectedGraphConnections<N,V>DirectedGraphConnections. ofImmutable(N thisNode, java.lang.Iterable<EndpointPair<N>> incidentEdges, Function<N,V> successorNodeToValueFn) -
Uses of Function in com.google.common.primitives
Classes in com.google.common.primitives that implement Function Modifier and Type Class Description private static classDoubles.DoubleConverterprivate static classFloats.FloatConverterprivate static classInts.IntConverterprivate static classLongs.LongConverterprivate static classShorts.ShortConverter -
Uses of Function in com.google.common.reflect
Fields in com.google.common.reflect declared as Function Modifier and Type Field Description private static Function<java.lang.reflect.Type,java.lang.String>Types. TYPE_NAMEClass#toString without the "class " and "interface " prefixes -
Uses of Function in com.google.common.testing
Methods in com.google.common.testing with parameters of type Function Modifier and Type Method Description private static <T> voidForwardingWrapperTester. testEquals(java.lang.Class<T> interfaceType, Function<? super T,? extends T> wrapperFunction)private static <T> voidForwardingWrapperTester. testExceptionPropagation(java.lang.Class<T> interfaceType, java.lang.reflect.Method method, Function<? super T,? extends T> wrapperFunction)<T> voidForwardingWrapperTester. testForwarding(java.lang.Class<T> interfaceType, Function<? super T,? extends T> wrapperFunction)Tests that the forwarding wrapper returned bywrapperFunctionproperly forwards method calls with parameters passed as is, return value returned as is, and exceptions propagated as is.(package private) voidForwardingWrapperTester.InteractionTester. testInteraction(Function<? super T,? extends T> wrapperFunction)private static <T> voidForwardingWrapperTester. testSuccessfulForwarding(java.lang.Class<T> interfaceType, java.lang.reflect.Method method, Function<? super T,? extends T> wrapperFunction)private static <T> voidForwardingWrapperTester. testToString(java.lang.Class<T> interfaceType, Function<? super T,? extends T> wrapperFunction) -
Uses of Function in com.google.common.util.concurrent
Fields in com.google.common.util.concurrent declared as Function Modifier and Type Field Description private static Function<ClosingFuture<?>,FluentFuture<?>>ClosingFuture.Combiner. INNER_FUTUREMethods in com.google.common.util.concurrent with parameters of type Function Modifier and Type Method Description <X extends java.lang.Throwable>
FluentFuture<V>FluentFuture. catching(java.lang.Class<X> exceptionType, Function<? super X,? extends V> fallback, java.util.concurrent.Executor executor)Returns aFuturewhose result is taken from thisFutureor, if thisFuturefails with the givenexceptionType, from the result provided by thefallback.static <V,X extends java.lang.Throwable>
ListenableFuture<V>Futures. catching(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, Function<? super X,? extends V> fallback, java.util.concurrent.Executor executor)Returns aFuturewhose result is taken from the given primaryinputor, if the primary input fails with the givenexceptionType, from the result provided by thefallback.(package private) static <V,X extends java.lang.Throwable>
ListenableFuture<V>AbstractCatchingFuture. create(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, Function<? super X,? extends V> fallback, java.util.concurrent.Executor executor)(package private) static <I,O>
ListenableFuture<O>AbstractTransformFuture. create(ListenableFuture<I> input, Function<? super I,? extends O> function, java.util.concurrent.Executor executor)(package private) VAbstractCatchingFuture.CatchingFuture. doFallback(Function<? super X,? extends V> fallback, X cause)(package private) OAbstractTransformFuture.TransformFuture. doTransform(Function<? super I,? extends O> function, I input)static <I,O>
java.util.concurrent.Future<O>Futures. lazyTransform(java.util.concurrent.Future<I> input, Function<? super I,? extends O> function)LikeFutures.transform(ListenableFuture, Function, Executor)except that the transformationfunctionis invoked on each call toget()on the returned future.<T> FluentFuture<T>FluentFuture. transform(Function<? super V,T> function, java.util.concurrent.Executor executor)Returns a newFuturewhose result is derived from the result of thisFuture.static <I,O>
ListenableFuture<O>Futures. transform(ListenableFuture<I> input, Function<? super I,? extends O> function, java.util.concurrent.Executor executor)Returns a newFuturewhose result is derived from the result of the givenFuture.Constructors in com.google.common.util.concurrent with parameters of type Function Constructor Description CatchingFuture(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, Function<? super X,? extends V> fallback)TransformFuture(ListenableFuture<? extends I> inputFuture, Function<? super I,? extends O> function)
-