Package | Description |
---|---|
org.apache.commons.collections4 |
This package contains the interfaces and utilities shared across all the subpackages of this component.
|
org.apache.commons.collections4.bag | |
org.apache.commons.collections4.collection |
This package contains implementations of the
Collection interface. |
org.apache.commons.collections4.comparators |
This package contains implementations of the
Comparator interface. |
org.apache.commons.collections4.functors |
This package contains implementations of the
Closure ,
Predicate ,
Transformer and
Factory interfaces. |
org.apache.commons.collections4.iterators |
This package contains implementations of the
Iterator interface. |
org.apache.commons.collections4.list |
This package contains implementations of the
List interface. |
org.apache.commons.collections4.map | |
org.apache.commons.collections4.multimap |
This package contains implementations of the
MultiValuedMap interfaces. |
org.apache.commons.collections4.queue |
This package contains implementations for the
Queue interface. |
org.apache.commons.collections4.set | |
org.apache.commons.collections4.splitmap |
Modifier and Type | Method and Description |
---|---|
static <T> Transformer<T,T> |
TransformerUtils.asTransformer(Closure<? super T> closure)
Creates a Transformer that calls a Closure each time the transformer is used.
|
static <I,O> Transformer<I,O> |
TransformerUtils.asTransformer(Factory<? extends O> factory)
Creates a Transformer that calls a Factory each time the transformer is used.
|
static <T> Transformer<T,Boolean> |
TransformerUtils.asTransformer(Predicate<? super T> predicate)
Creates a Transformer that calls a Predicate each time the transformer is used.
|
static <T> Transformer<T,T> |
TransformerUtils.chainedTransformer(Collection<? extends Transformer<? super T,? extends T>> transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer.
|
static <T> Transformer<T,T> |
TransformerUtils.chainedTransformer(Transformer<? super T,? extends T>... transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer.
|
static <T> Transformer<T,T> |
TransformerUtils.cloneTransformer()
Gets a transformer that returns a clone of the input object.
|
static <I,O> Transformer<I,O> |
TransformerUtils.constantTransformer(O constantToReturn)
Creates a Transformer that will return the same object each time the
transformer is used.
|
static <I,O> Transformer<I,O> |
TransformerUtils.exceptionTransformer()
Gets a transformer that always throws an exception.
|
static <I,O> Transformer<I,O> |
TransformerUtils.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Create a new Transformer that calls one of two transformers depending
on the specified predicate.
|
static <T> Transformer<T,T> |
TransformerUtils.ifTransformer(Predicate<? super T> predicate,
Transformer<? super T,? extends T> trueTransformer)
Create a new Transformer that calls the transformer if the predicate is true,
otherwise the input object is returned unchanged.
|
static <T> Transformer<Class<? extends T>,T> |
TransformerUtils.instantiateTransformer()
Gets a Transformer that expects an input Class object that it will instantiate.
|
static <T> Transformer<Class<? extends T>,T> |
TransformerUtils.instantiateTransformer(Class<?>[] paramTypes,
Object[] args)
Creates a Transformer that expects an input Class object that it will
instantiate.
|
static <I,O> Transformer<I,O> |
TransformerUtils.invokerTransformer(String methodName)
Gets a Transformer that invokes a method on the input object.
|
static <I,O> Transformer<I,O> |
TransformerUtils.invokerTransformer(String methodName,
Class<?>[] paramTypes,
Object[] args)
Gets a Transformer that invokes a method on the input object.
|
static <I,O> Transformer<I,O> |
TransformerUtils.mapTransformer(Map<? super I,? extends O> map)
Creates a Transformer that uses the passed in Map to transform the input
object (as a simple lookup).
|
static <T> Transformer<T,T> |
TransformerUtils.nopTransformer()
Gets a transformer that returns the input object.
|
static <I,O> Transformer<I,O> |
TransformerUtils.nullTransformer()
Gets a transformer that always returns null.
|
static <T> Transformer<T,String> |
TransformerUtils.stringValueTransformer()
Gets a transformer that returns a
java.lang.String
representation of the input object. |
static <I,O> Transformer<I,O> |
TransformerUtils.switchMapTransformer(Map<I,Transformer<I,O>> objectsAndTransformers)
Create a new Transformer that uses the input object as a key to find the
transformer to call.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Map<Predicate<I>,Transformer<I,O>> predicatesAndTransformers)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static <E> Closure<E> |
ClosureUtils.asClosure(Transformer<? super E,?> transformer)
Creates a Closure that calls a Transformer each time it is called.
|
static <T> Predicate<T> |
PredicateUtils.asPredicate(Transformer<? super T,Boolean> transformer)
Create a new Predicate that wraps a Transformer.
|
static <T> Transformer<T,T> |
TransformerUtils.chainedTransformer(Transformer<? super T,? extends T>... transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer.
|
static <I,O,R extends Collection<? super O>> |
CollectionUtils.collect(Iterable<? extends I> inputCollection,
Transformer<? super I,? extends O> transformer,
R outputCollection)
Transforms all elements from input collection with the given transformer
and adds them to the output collection.
|
static <I,O> Collection<O> |
CollectionUtils.collect(Iterable<I> inputCollection,
Transformer<? super I,? extends O> transformer)
Returns a new Collection containing all elements of the input collection
transformed by the given transformer.
|
static <I,O,R extends Collection<? super O>> |
CollectionUtils.collect(Iterator<? extends I> inputIterator,
Transformer<? super I,? extends O> transformer,
R outputCollection)
Transforms all elements from the input iterator with the given transformer
and adds them to the output collection.
|
static <I,O> Collection<O> |
CollectionUtils.collect(Iterator<I> inputIterator,
Transformer<? super I,? extends O> transformer)
Transforms all elements from the input iterator with the given transformer
and adds them to the output collection.
|
static <I,O> Transformer<I,O> |
TransformerUtils.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Create a new Transformer that calls one of two transformers depending
on the specified predicate.
|
static <I,O> Transformer<I,O> |
TransformerUtils.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Create a new Transformer that calls one of two transformers depending
on the specified predicate.
|
static <T> Transformer<T,T> |
TransformerUtils.ifTransformer(Predicate<? super T> predicate,
Transformer<? super T,? extends T> trueTransformer)
Create a new Transformer that calls the transformer if the predicate is true,
otherwise the input object is returned unchanged.
|
static <E> List<E> |
ListUtils.lazyList(List<E> list,
Transformer<Integer,? extends E> transformer)
Returns a "lazy" list whose elements will be created on demand.
|
static <K,V> IterableMap<K,V> |
MapUtils.lazyMap(Map<K,V> map,
Transformer<? super K,? extends V> transformerFactory)
Returns a "lazy" map whose values will be created on demand.
|
static <K,V> SortedMap<K,V> |
MapUtils.lazySortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends V> transformerFactory)
Returns a "lazy" sorted map whose values will be created on demand.
|
static <E> Iterator<E> |
IteratorUtils.objectGraphIterator(E root,
Transformer<? super E,? extends E> transformer)
Gets an iterator that operates over an object graph.
|
static <K,V,E> void |
MapUtils.populateMap(Map<K,V> map,
Iterable<? extends E> elements,
Transformer<E,K> keyTransformer,
Transformer<E,V> valueTransformer)
Populates a Map using the supplied
Transformer s to transform the elements
into keys and values. |
static <K,V,E> void |
MapUtils.populateMap(Map<K,V> map,
Iterable<? extends E> elements,
Transformer<E,K> keyTransformer,
Transformer<E,V> valueTransformer)
Populates a Map using the supplied
Transformer s to transform the elements
into keys and values. |
static <K,V> void |
MapUtils.populateMap(Map<K,V> map,
Iterable<? extends V> elements,
Transformer<V,K> keyTransformer)
Populates a Map using the supplied
Transformer to transform the elements
into keys, using the unaltered element as the value in the Map . |
static <K,V,E> void |
MapUtils.populateMap(MultiMap<K,V> map,
Iterable<? extends E> elements,
Transformer<E,K> keyTransformer,
Transformer<E,V> valueTransformer)
Populates a MultiMap using the supplied
Transformer s to transform the elements
into keys and values. |
static <K,V,E> void |
MapUtils.populateMap(MultiMap<K,V> map,
Iterable<? extends E> elements,
Transformer<E,K> keyTransformer,
Transformer<E,V> valueTransformer)
Populates a MultiMap using the supplied
Transformer s to transform the elements
into keys and values. |
static <K,V> void |
MapUtils.populateMap(MultiMap<K,V> map,
Iterable<? extends V> elements,
Transformer<V,K> keyTransformer)
Populates a MultiMap using the supplied
Transformer to transform the elements
into keys, using the unaltered element as the value in the MultiMap . |
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Deprecated.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Deprecated.
|
static <E> String |
IterableUtils.toString(Iterable<E> iterable,
Transformer<? super E,String> transformer)
Returns a string representation of the elements of the specified iterable.
|
static <E> String |
IterableUtils.toString(Iterable<E> iterable,
Transformer<? super E,String> transformer,
String delimiter,
String prefix,
String suffix)
Returns a string representation of the elements of the specified iterable.
|
static <E> String |
IteratorUtils.toString(Iterator<E> iterator,
Transformer<? super E,String> transformer)
Returns a string representation of the elements of the specified iterator.
|
static <E> String |
IteratorUtils.toString(Iterator<E> iterator,
Transformer<? super E,String> transformer,
String delimiter,
String prefix,
String suffix)
Returns a string representation of the elements of the specified iterator.
|
static <C> void |
CollectionUtils.transform(Collection<C> collection,
Transformer<? super C,? extends C> transformer)
Transform the collection by applying a Transformer to each element.
|
<O> FluentIterable<O> |
FluentIterable.transform(Transformer<? super E,? extends O> transformer)
Returns a new FluentIterable whose iterator will return all elements
of this iterable transformed by the provided transformer.
|
static <I,O> Comparator<I> |
ComparatorUtils.transformedComparator(Comparator<O> comparator,
Transformer<? super I,? extends O> transformer)
Gets a Comparator that passes transformed objects to the given comparator.
|
static <I,O> Iterable<O> |
IterableUtils.transformedIterable(Iterable<I> iterable,
Transformer<? super I,? extends O> transformer)
Returns a transformed view of the given iterable where all of its elements
have been transformed by the provided transformer.
|
static <I,O> Iterator<O> |
IteratorUtils.transformedIterator(Iterator<? extends I> iterator,
Transformer<? super I,? extends O> transform)
Gets an iterator that transforms the elements of another iterator.
|
static <E> List<E> |
ListUtils.transformedList(List<E> list,
Transformer<? super E,? extends E> transformer)
Returns a transformed list backed by the given list.
|
static <K,V> IterableMap<K,V> |
MapUtils.transformedMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Returns a transformed map backed by the given map.
|
static <K,V> IterableMap<K,V> |
MapUtils.transformedMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Returns a transformed map backed by the given map.
|
static <K,V> MultiValuedMap<K,V> |
MultiMapUtils.transformedMultiValuedMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Returns a
TransformedMultiValuedMap backed by the given map. |
static <K,V> MultiValuedMap<K,V> |
MultiMapUtils.transformedMultiValuedMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Returns a
TransformedMultiValuedMap backed by the given map. |
static <E> SortedSet<E> |
SetUtils.transformedNavigableSet(NavigableSet<E> set,
Transformer<? super E,? extends E> transformer)
Returns a transformed navigable set backed by the given navigable set.
|
static <T> Predicate<T> |
PredicateUtils.transformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate)
Creates a predicate that transforms the input object before passing it
to the predicate.
|
static <E> Set<E> |
SetUtils.transformedSet(Set<E> set,
Transformer<? super E,? extends E> transformer)
Returns a transformed set backed by the given set.
|
static <K,V> SortedMap<K,V> |
MapUtils.transformedSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Returns a transformed sorted map backed by the given map.
|
static <K,V> SortedMap<K,V> |
MapUtils.transformedSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Returns a transformed sorted map backed by the given map.
|
static <E> SortedSet<E> |
SetUtils.transformedSortedSet(SortedSet<E> set,
Transformer<? super E,? extends E> transformer)
Returns a transformed sorted set backed by the given set.
|
static <E> Bag<E> |
BagUtils.transformingBag(Bag<E> bag,
Transformer<? super E,? extends E> transformer)
Returns a transformed bag backed by the given bag.
|
static <E> Collection<E> |
CollectionUtils.transformingCollection(Collection<E> collection,
Transformer<? super E,? extends E> transformer)
Returns a transformed bag backed by the given collection.
|
static <E> Queue<E> |
QueueUtils.transformingQueue(Queue<E> queue,
Transformer<? super E,? extends E> transformer)
Returns a transformed queue backed by the given queue.
|
static <E> SortedBag<E> |
BagUtils.transformingSortedBag(SortedBag<E> bag,
Transformer<? super E,? extends E> transformer)
Returns a transformed sorted bag backed by the given bag.
|
Modifier and Type | Method and Description |
---|---|
static <T> Transformer<T,T> |
TransformerUtils.chainedTransformer(Collection<? extends Transformer<? super T,? extends T>> transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchMapTransformer(Map<I,Transformer<I,O>> objectsAndTransformers)
Create a new Transformer that uses the input object as a key to find the
transformer to call.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Map<Predicate<I>,Transformer<I,O>> predicatesAndTransformers)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
Modifier and Type | Method and Description |
---|---|
static <E> Bag<E> |
TransformedBag.transformedBag(Bag<E> bag,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming bag that will transform
existing contents of the specified bag.
|
static <E> TransformedSortedBag<E> |
TransformedSortedBag.transformedSortedBag(SortedBag<E> bag,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming sorted bag that will transform
existing contents of the specified sorted bag.
|
static <E> Bag<E> |
TransformedBag.transformingBag(Bag<E> bag,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming bag.
|
static <E> TransformedSortedBag<E> |
TransformedSortedBag.transformingSortedBag(SortedBag<E> bag,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming sorted bag.
|
Constructor and Description |
---|
TransformedBag(Bag<E> bag,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
TransformedSortedBag(SortedBag<E> bag,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
Modifier and Type | Field and Description |
---|---|
protected Transformer<? super E,? extends E> |
TransformedCollection.transformer
The transformer to use
|
Modifier and Type | Method and Description |
---|---|
static <K,C> IndexedCollection<K,C> |
IndexedCollection.nonUniqueIndexedCollection(Collection<C> coll,
Transformer<C,K> keyTransformer)
Create an
IndexedCollection for a non-unique index. |
static <E> TransformedCollection<E> |
TransformedCollection.transformedCollection(Collection<E> collection,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming collection that will transform
existing contents of the specified collection.
|
static <E> TransformedCollection<E> |
TransformedCollection.transformingCollection(Collection<E> coll,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming collection.
|
static <K,C> IndexedCollection<K,C> |
IndexedCollection.uniqueIndexedCollection(Collection<C> coll,
Transformer<C,K> keyTransformer)
Create an
IndexedCollection for a unique index. |
Constructor and Description |
---|
IndexedCollection(Collection<C> coll,
Transformer<C,K> keyTransformer,
MultiMap<K,C> map,
boolean uniqueIndex)
Create a
IndexedCollection . |
TransformedCollection(Collection<E> coll,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
Constructor and Description |
---|
TransformingComparator(Transformer<? super I,? extends O> transformer)
Constructs an instance with the given Transformer and a
ComparableComparator . |
TransformingComparator(Transformer<? super I,? extends O> transformer,
Comparator<O> decorated)
Constructs an instance with the given Transformer and Comparator.
|
Modifier and Type | Class and Description |
---|---|
class |
ChainedTransformer<T>
Transformer implementation that chains the specified transformers together.
|
class |
CloneTransformer<T>
Transformer implementation that returns a clone of the input object.
|
class |
ClosureTransformer<T>
Transformer implementation that calls a Closure using the input object
and then returns the input.
|
class |
ConstantTransformer<I,O>
Transformer implementation that returns the same constant each time.
|
class |
ExceptionTransformer<I,O>
Transformer implementation that always throws an exception.
|
class |
FactoryTransformer<I,O>
Transformer implementation that calls a Factory and returns the result.
|
class |
IfTransformer<I,O>
Transformer implementation that will call one of two closures based on whether a predicate evaluates
as true or false.
|
class |
InstantiateTransformer<T>
Transformer implementation that creates a new object instance by reflection.
|
class |
InvokerTransformer<I,O>
Transformer implementation that creates a new object instance by reflection.
|
class |
MapTransformer<I,O>
Transformer implementation that returns the value held in a specified map
using the input parameter as a key.
|
class |
NOPTransformer<T>
Transformer implementation that does nothing.
|
class |
PredicateTransformer<T>
Transformer implementation that calls a Predicate using the input object
and then returns the result.
|
class |
StringValueTransformer<T>
Transformer implementation that returns the result of calling
String.valueOf on the input object. |
class |
SwitchTransformer<I,O>
Transformer implementation calls the transformer whose predicate returns true,
like a switch statement.
|
Modifier and Type | Field and Description |
---|---|
static Transformer |
CloneTransformer.INSTANCE
Singleton predicate instance
|
static Transformer |
ExceptionTransformer.INSTANCE
Singleton predicate instance
|
static Transformer |
NOPTransformer.INSTANCE
Singleton predicate instance
|
static Transformer |
ConstantTransformer.NULL_INSTANCE
Returns null each time
|
Modifier and Type | Method and Description |
---|---|
static <T> Transformer<T,T> |
ChainedTransformer.chainedTransformer(Collection<? extends Transformer<? super T,? extends T>> transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer.
|
static <T> Transformer<T,T> |
ChainedTransformer.chainedTransformer(Transformer<? super T,? extends T>... transformers)
Factory method that performs validation and copies the parameter array.
|
static <T> Transformer<T,T> |
CloneTransformer.cloneTransformer()
Factory returning the singleton instance.
|
static <T> Transformer<T,T> |
ClosureTransformer.closureTransformer(Closure<? super T> closure)
Factory method that performs validation.
|
static <I,O> Transformer<I,O> |
ConstantTransformer.constantTransformer(O constantToReturn)
Transformer method that performs validation.
|
static <I,O> Transformer<I,O> |
ExceptionTransformer.exceptionTransformer()
Factory returning the singleton instance.
|
static <I,O> Transformer<I,O> |
FactoryTransformer.factoryTransformer(Factory<? extends O> factory)
Factory method that performs validation.
|
Transformer<? super I,? extends O> |
SwitchTransformer.getDefaultTransformer()
Gets the default transformer.
|
Transformer<? super I,? extends O> |
IfTransformer.getFalseTransformer()
Gets the transformer used when false.
|
Transformer<? super T,? extends T> |
TransformedPredicate.getTransformer()
Gets the transformer in use.
|
Transformer<? super E,?> |
TransformerClosure.getTransformer()
Gets the transformer.
|
Transformer<? super T,Boolean> |
TransformerPredicate.getTransformer()
Gets the transformer.
|
Transformer<? super T,? extends T>[] |
ChainedTransformer.getTransformers()
Gets the transformers.
|
Transformer<? super I,? extends O>[] |
SwitchTransformer.getTransformers()
Gets the transformers.
|
Transformer<? super I,? extends O> |
IfTransformer.getTrueTransformer()
Gets the transformer used when true.
|
static <I,O> Transformer<I,O> |
IfTransformer.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Factory method that performs validation.
|
static <T> Transformer<T,T> |
IfTransformer.ifTransformer(Predicate<? super T> predicate,
Transformer<? super T,? extends T> trueTransformer)
Factory method that performs validation.
|
static <T> Transformer<Class<? extends T>,T> |
InstantiateTransformer.instantiateTransformer()
Get a typed no-arg instance.
|
static <T> Transformer<Class<? extends T>,T> |
InstantiateTransformer.instantiateTransformer(Class<?>[] paramTypes,
Object[] args)
Transformer method that performs validation.
|
static <I,O> Transformer<I,O> |
InvokerTransformer.invokerTransformer(String methodName)
Gets an instance of this transformer calling a specific method with no arguments.
|
static <I,O> Transformer<I,O> |
InvokerTransformer.invokerTransformer(String methodName,
Class<?>[] paramTypes,
Object[] args)
Gets an instance of this transformer calling a specific method with specific values.
|
static <I,O> Transformer<I,O> |
MapTransformer.mapTransformer(Map<? super I,? extends O> map)
Factory to create the transformer.
|
static <T> Transformer<T,T> |
NOPTransformer.nopTransformer()
Factory returning the singleton instance.
|
static <I,O> Transformer<I,O> |
ConstantTransformer.nullTransformer()
Get a typed null instance.
|
static <T> Transformer<T,Boolean> |
PredicateTransformer.predicateTransformer(Predicate<? super T> predicate)
Factory method that performs validation.
|
static <T> Transformer<T,String> |
StringValueTransformer.stringValueTransformer()
Factory returning the singleton instance.
|
static <I,O> Transformer<I,O> |
SwitchTransformer.switchTransformer(Map<? extends Predicate<? super I>,? extends Transformer<? super I,? extends O>> map)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
SwitchTransformer.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Factory method that performs validation and copies the parameter arrays.
|
Modifier and Type | Method and Description |
---|---|
static <T> Transformer<T,T> |
ChainedTransformer.chainedTransformer(Transformer<? super T,? extends T>... transformers)
Factory method that performs validation and copies the parameter array.
|
static <I,O> Transformer<I,O> |
IfTransformer.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Factory method that performs validation.
|
static <I,O> Transformer<I,O> |
IfTransformer.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Factory method that performs validation.
|
static <T> Transformer<T,T> |
IfTransformer.ifTransformer(Predicate<? super T> predicate,
Transformer<? super T,? extends T> trueTransformer)
Factory method that performs validation.
|
static <I,O> Transformer<I,O> |
SwitchTransformer.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Factory method that performs validation and copies the parameter arrays.
|
static <I,O> Transformer<I,O> |
SwitchTransformer.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Factory method that performs validation and copies the parameter arrays.
|
static <T> Predicate<T> |
TransformedPredicate.transformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate)
Factory to create the predicate.
|
static <E> Closure<E> |
TransformerClosure.transformerClosure(Transformer<? super E,?> transformer)
Factory method that performs validation.
|
static <T> Predicate<T> |
TransformerPredicate.transformerPredicate(Transformer<? super T,Boolean> transformer)
Factory to create the predicate.
|
Modifier and Type | Method and Description |
---|---|
static <T> Transformer<T,T> |
ChainedTransformer.chainedTransformer(Collection<? extends Transformer<? super T,? extends T>> transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer.
|
static <I,O> Transformer<I,O> |
SwitchTransformer.switchTransformer(Map<? extends Predicate<? super I>,? extends Transformer<? super I,? extends O>> map)
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
Constructor and Description |
---|
ChainedTransformer(Transformer<? super T,? extends T>... transformers)
Constructor that performs no validation.
|
IfTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Constructor that performs no validation.
|
IfTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer)
Constructor that performs no validation.
|
SwitchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Constructor that performs no validation.
|
SwitchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer)
Constructor that performs no validation.
|
TransformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate)
Constructor that performs no validation.
|
TransformerClosure(Transformer<? super E,?> transformer)
Constructor that performs no validation.
|
TransformerPredicate(Transformer<? super T,Boolean> transformer)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
Transformer<? super I,? extends O> |
TransformIterator.getTransformer()
Gets the transformer this iterator is using.
|
Modifier and Type | Method and Description |
---|---|
void |
TransformIterator.setTransformer(Transformer<? super I,? extends O> transformer)
Sets the transformer this the iterator to use.
|
Constructor and Description |
---|
ObjectGraphIterator(E root,
Transformer<? super E,? extends E> transformer)
Constructs an ObjectGraphIterator using a root object and transformer.
|
TransformIterator(Iterator<? extends I> iterator,
Transformer<? super I,? extends O> transformer)
Constructs a new
TransformIterator that will use the
given iterator and transformer. |
Modifier and Type | Method and Description |
---|---|
static <E> LazyList<E> |
LazyList.lazyList(List<E> list,
Transformer<Integer,? extends E> transformer)
Transformer method to create a lazily instantiating list.
|
static <E> TransformedList<E> |
TransformedList.transformedList(List<E> list,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming list that will transform
existing contents of the specified list.
|
static <E> TransformedList<E> |
TransformedList.transformingList(List<E> list,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming list.
|
Constructor and Description |
---|
LazyList(List<E> list,
Transformer<Integer,? extends E> transformer)
Constructor that wraps (not copies).
|
TransformedList(List<E> list,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
Modifier and Type | Field and Description |
---|---|
protected Transformer<? super K,? extends V> |
LazyMap.factory
The factory to use to construct elements
|
protected Transformer<? super K,? extends K> |
TransformedMap.keyTransformer
The transformer to use for the key
|
protected Transformer<? super V,? extends V> |
TransformedMap.valueTransformer
The transformer to use for the value
|
Modifier and Type | Method and Description |
---|---|
static <K,V> Map<K,V> |
DefaultedMap.defaultedMap(Map<K,V> map,
Transformer<? super K,? extends V> transformer)
Factory method to create a defaulting map.
|
static <V,K> LazyMap<K,V> |
LazyMap.lazyMap(Map<K,V> map,
Transformer<? super K,? extends V> factory)
Factory method to create a lazily instantiated map.
|
static <K,V> LazySortedMap<K,V> |
LazySortedMap.lazySortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends V> factory)
Factory method to create a lazily instantiated sorted map.
|
static <K,V> TransformedMap<K,V> |
TransformedMap.transformedMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming map that will transform
existing contents of the specified map.
|
static <K,V> TransformedMap<K,V> |
TransformedMap.transformedMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming map that will transform
existing contents of the specified map.
|
static <K,V> TransformedSortedMap<K,V> |
TransformedSortedMap.transformedSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming sorted map that will transform
existing contents of the specified map.
|
static <K,V> TransformedSortedMap<K,V> |
TransformedSortedMap.transformedSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming sorted map that will transform
existing contents of the specified map.
|
static <K,V> TransformedMap<K,V> |
TransformedMap.transformingMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming map.
|
static <K,V> TransformedMap<K,V> |
TransformedMap.transformingMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming map.
|
static <K,V> TransformedSortedMap<K,V> |
TransformedSortedMap.transformingSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming sorted map.
|
static <K,V> TransformedSortedMap<K,V> |
TransformedSortedMap.transformingSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming sorted map.
|
Constructor and Description |
---|
DefaultedMap(Map<K,V> map,
Transformer<? super K,? extends V> defaultValueTransformer)
Constructor that wraps (not copies).
|
DefaultedMap(Transformer<? super K,? extends V> defaultValueTransformer)
Constructs a new empty
DefaultedMap that decorates a HashMap . |
LazyMap(Map<K,V> map,
Transformer<? super K,? extends V> factory)
Constructor that wraps (not copies).
|
LazySortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends V> factory)
Constructor that wraps (not copies).
|
TransformedMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
TransformedMap(Map<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
TransformedSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
TransformedSortedMap(SortedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
static <K,V> TransformedMultiValuedMap<K,V> |
TransformedMultiValuedMap.transformedMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming MultiValuedMap that will
transform existing contents of the specified map.
|
static <K,V> TransformedMultiValuedMap<K,V> |
TransformedMultiValuedMap.transformedMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming MultiValuedMap that will
transform existing contents of the specified map.
|
static <K,V> TransformedMultiValuedMap<K,V> |
TransformedMultiValuedMap.transformingMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming MultiValuedMap.
|
static <K,V> TransformedMultiValuedMap<K,V> |
TransformedMultiValuedMap.transformingMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Factory method to create a transforming MultiValuedMap.
|
Constructor and Description |
---|
TransformedMultiValuedMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
TransformedMultiValuedMap(MultiValuedMap<K,V> map,
Transformer<? super K,? extends K> keyTransformer,
Transformer<? super V,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
static <E> TransformedQueue<E> |
TransformedQueue.transformedQueue(Queue<E> queue,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming queue that will transform
existing contents of the specified queue.
|
static <E> TransformedQueue<E> |
TransformedQueue.transformingQueue(Queue<E> queue,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming queue.
|
Constructor and Description |
---|
TransformedQueue(Queue<E> queue,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
static <E> TransformedNavigableSet<E> |
TransformedNavigableSet.transformedNavigableSet(NavigableSet<E> set,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming navigable set that will transform
existing contents of the specified navigable set.
|
static <E> Set<E> |
TransformedSet.transformedSet(Set<E> set,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming set that will transform
existing contents of the specified set.
|
static <E> TransformedSortedSet<E> |
TransformedSortedSet.transformedSortedSet(SortedSet<E> set,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming sorted set that will transform
existing contents of the specified sorted set.
|
static <E> TransformedNavigableSet<E> |
TransformedNavigableSet.transformingNavigableSet(NavigableSet<E> set,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming navigable set.
|
static <E> TransformedSet<E> |
TransformedSet.transformingSet(Set<E> set,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming set.
|
static <E> TransformedSortedSet<E> |
TransformedSortedSet.transformingSortedSet(SortedSet<E> set,
Transformer<? super E,? extends E> transformer)
Factory method to create a transforming sorted set.
|
Constructor and Description |
---|
TransformedNavigableSet(NavigableSet<E> set,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
TransformedSet(Set<E> set,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
TransformedSortedSet(SortedSet<E> set,
Transformer<? super E,? extends E> transformer)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
static <J,K,U,V> TransformedSplitMap<J,K,U,V> |
TransformedSplitMap.transformingMap(Map<K,V> map,
Transformer<? super J,? extends K> keyTransformer,
Transformer<? super U,? extends V> valueTransformer)
Factory method to create a transforming map.
|
static <J,K,U,V> TransformedSplitMap<J,K,U,V> |
TransformedSplitMap.transformingMap(Map<K,V> map,
Transformer<? super J,? extends K> keyTransformer,
Transformer<? super U,? extends V> valueTransformer)
Factory method to create a transforming map.
|
Constructor and Description |
---|
TransformedSplitMap(Map<K,V> map,
Transformer<? super J,? extends K> keyTransformer,
Transformer<? super U,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
TransformedSplitMap(Map<K,V> map,
Transformer<? super J,? extends K> keyTransformer,
Transformer<? super U,? extends V> valueTransformer)
Constructor that wraps (not copies).
|
Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.