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.functors |
This package contains implementations of the
Closure ,
Predicate ,
Transformer and
Factory interfaces. |
org.apache.commons.collections4.list |
This package contains implementations of the
List interface. |
org.apache.commons.collections4.map |
Modifier and Type | Method | Description |
---|---|---|
static <T> Factory<T> |
FactoryUtils.constantFactory(T constantToReturn) |
Creates a Factory that will return the same object each time the factory
is used.
|
static <T> Factory<T> |
FactoryUtils.exceptionFactory() |
Gets a Factory that always throws an exception.
|
static <T> Factory<T> |
FactoryUtils.instantiateFactory(java.lang.Class<T> classToInstantiate) |
Creates a Factory that can create objects of a specific type using
a no-args constructor.
|
static <T> Factory<T> |
FactoryUtils.instantiateFactory(java.lang.Class<T> classToInstantiate,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] args) |
Creates a Factory that can create objects of a specific type using
the arguments specified to this method.
|
static <T> Factory<T> |
FactoryUtils.nullFactory() |
Gets a Factory that will return null each time the factory is used.
|
static <T> Factory<T> |
FactoryUtils.prototypeFactory(T prototype) |
Creates a Factory that will return a clone of the same prototype object
each time the factory is used.
|
Modifier and Type | Method | Description |
---|---|---|
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 <E> java.util.List<E> |
ListUtils.lazyList(java.util.List<E> list,
Factory<? extends E> factory) |
Returns a "lazy" list whose elements will be created on demand.
|
static <K,V> IterableMap<K,V> |
MapUtils.lazyMap(java.util.Map<K,V> map,
Factory<? extends V> factory) |
Returns a "lazy" map whose values will be created on demand.
|
static <K,V> java.util.SortedMap<K,V> |
MapUtils.lazySortedMap(java.util.SortedMap<K,V> map,
Factory<? extends V> factory) |
Returns a "lazy" sorted map whose values will be created on demand.
|
static <K,V,C extends java.util.Collection<V>> |
MapUtils.multiValueMap(java.util.Map<K,C> map,
Factory<C> collectionFactory) |
Deprecated.
since 4.1, use
MultiValuedMap instead |
static <O,R extends java.util.Collection<O>> |
IterableUtils.partition(java.lang.Iterable<? extends O> iterable,
Factory<R> partitionFactory,
Predicate<? super O>... predicates) |
Partitions all elements from iterable into separate output collections,
based on the evaluation of the given predicates.
|
Modifier and Type | Class | Description |
---|---|---|
class |
ConstantFactory<T> |
Factory implementation that returns the same constant each time.
|
class |
ExceptionFactory<T> |
Factory implementation that always throws an exception.
|
class |
InstantiateFactory<T> |
Factory implementation that creates a new object instance by reflection.
|
Modifier and Type | Field | Description |
---|---|---|
static Factory |
ExceptionFactory.INSTANCE |
Singleton predicate instance
|
static Factory |
ConstantFactory.NULL_INSTANCE |
Returns null each time
|
Modifier and Type | Method | Description |
---|---|---|
static <T> Factory<T> |
ConstantFactory.constantFactory(T constantToReturn) |
Factory method that performs validation.
|
static <T> Factory<T> |
ExceptionFactory.exceptionFactory() |
Factory returning the singleton instance.
|
Factory<? extends O> |
FactoryTransformer.getFactory() |
Gets the factory.
|
static <T> Factory<T> |
InstantiateFactory.instantiateFactory(java.lang.Class<T> classToInstantiate,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] args) |
Factory method that performs validation.
|
static <T> Factory<T> |
PrototypeFactory.prototypeFactory(T prototype) |
Factory method that performs validation.
|
Modifier and Type | Method | Description |
---|---|---|
static <I,O> Transformer<I,O> |
FactoryTransformer.factoryTransformer(Factory<? extends O> factory) |
Factory method that performs validation.
|
Constructor | Description |
---|---|
FactoryTransformer(Factory<? extends O> factory) |
Constructor that performs no validation.
|
Modifier and Type | Method | Description |
---|---|---|
static <E> LazyList<E> |
LazyList.lazyList(java.util.List<E> list,
Factory<? extends E> factory) |
Factory method to create a lazily instantiating list.
|
Constructor | Description |
---|---|
LazyList(java.util.List<E> list,
Factory<? extends E> factory) |
Constructor that wraps (not copies).
|
Modifier and Type | Method | Description |
---|---|---|
static <K,V> DefaultedMap<K,V> |
DefaultedMap.defaultedMap(java.util.Map<K,V> map,
Factory<? extends V> factory) |
Factory method to create a defaulting map.
|
static <K,V> LazyMap<K,V> |
LazyMap.lazyMap(java.util.Map<K,V> map,
Factory<? extends V> factory) |
Factory method to create a lazily instantiated map.
|
static <K,V> LazySortedMap<K,V> |
LazySortedMap.lazySortedMap(java.util.SortedMap<K,V> map,
Factory<? extends V> factory) |
Factory method to create a lazily instantiated sorted map.
|
static <K,V,C extends java.util.Collection<V>> |
MultiValueMap.multiValueMap(java.util.Map<K,? super C> map,
Factory<C> collectionFactory) |
Deprecated.
Creates a map which decorates the given
map and
creates the value collections using the supplied collectionFactory . |
Constructor | Description |
---|---|
LazyMap(java.util.Map<K,V> map,
Factory<? extends V> factory) |
Constructor that wraps (not copies).
|
LazySortedMap(java.util.SortedMap<K,V> map,
Factory<? extends V> factory) |
Constructor that wraps (not copies).
|
MultiValueMap(java.util.Map<K,? super C> map,
Factory<C> collectionFactory) |
Deprecated.
Creates a MultiValueMap which decorates the given
map and
creates the value collections using the supplied collectionFactory . |
Copyright © 2001-2019 - Apache Software Foundation