public final class CommonsCollections4Helper extends Object
This class is only available if commons-collections4 is available
The mapping between the interface from commons-collections4 and this library is the following :
| commons-collections4 | powerunit-extensions-exceptions |
|---|---|
| Predicate | PredicateWithException |
| Factory | SupplierWithException |
| Transformer | FunctionWithException |
| Closure | ConsumerWithException |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> org.apache.commons.collections4.Closure<T> |
asClosure(ConsumerWithException<T,?> consumer) |
Transforms a
ConsumerWithException to the one from
commons-collections. |
static <T> org.apache.commons.collections4.Factory<T> |
asFactory(SupplierWithException<T,?> supplier) |
Transforms a
SupplierWithException to the one from
commons-collections. |
static <T> org.apache.commons.collections4.Predicate<T> |
asPredicate(PredicateWithException<T,?> predicate) |
Transforms a
PredicateWithException to the one from
commons-collections. |
static <I,O> org.apache.commons.collections4.Transformer<I,O> |
asTransformer(FunctionWithException<I,O,?> function) |
Transforms a
FunctionWithException to the one from
commons-collections. |
public static <T> org.apache.commons.collections4.Predicate<T> asPredicate(PredicateWithException<T,?> predicate)
PredicateWithException to the one from
commons-collections.T - the type of the input argument for the predicatepredicate - the PredicateWithException to be transformed to the one
from commons-collections.predicate from
commons-collections. The ClassCastException and
IllegalArgumentException are not wrapped and the other exception are
wrapped in a FunctorException.NoClassDefFoundError - In case the commons-collections4 library is not available.NullPointerException - if predicate is null.Predicatepublic static <T> org.apache.commons.collections4.Factory<T> asFactory(SupplierWithException<T,?> supplier)
SupplierWithException to the one from
commons-collections.T - the type of the result of the suppliersupplier - the SupplierWithException to be transformed to the one
from commons-collections.factory from commons-collections. The exception
are wrapped in a FunctorException.NoClassDefFoundError - In case the commons-collections4 library is not available.NullPointerException - if supplier is null.Factorypublic static <I,O> org.apache.commons.collections4.Transformer<I,O> asTransformer(FunctionWithException<I,O,?> function)
FunctionWithException to the one from
commons-collections.I - the input argument type of the functionO - the result type of the functionfunction - the FunctionWithException to be transformed to the one
from commons-collections.transformer from commons-collections. The
ClassCastException and IllegalArgumentException are not wrapped and
the other exception are wrapped in a FunctorException.NoClassDefFoundError - In case the commons-collections4 library is not available.NullPointerException - if function is null.Transformerpublic static <T> org.apache.commons.collections4.Closure<T> asClosure(ConsumerWithException<T,?> consumer)
ConsumerWithException to the one from
commons-collections.T - the type of the input argument for the consumerconsumer - the ConsumerWithException to be transformed to the one
from commons-collections.closure from commons-collections. The
ClassCastException and IllegalArgumentException are not wrapped and
the other exception are wrapped in a FunctorException.NoClassDefFoundError - In case the commons-collections4 library is not available.NullPointerException - if consumer is null.ClosureCopyright © 2019. All rights reserved.