Deprecated
java.util.function package, or more
generally, with Java 8 lambdas. More specifically, it attempts to address the fact that lambdas are supposed not to
throw Exceptions, at least not checked Exceptions, AKA instances of Exception. This enforces the use of
constructs like:
Consumer<java.lang.reflect.Method> consumer = m -> {
try {
m.invoke(o, args);
} catch (Throwable t) {
throw Functions.rethrow(t);
}
};
By replacing a Consumer<O> with a FailableConsumer<O,? extends Throwable>, this can be written like follows:
Functions.accept((m) -> m.invoke(o,args));
Obviously, the second version is much more concise and the spirit of Lambda expressions is met better than the second version.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Functions.
Consumed type 1. O1, Consumed type 2. O2, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
BiConsumer that declares a Throwable.
|
| public static interface | Functions.
Input type 1. O1, Input type 2. O2, Return type. R, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
BiFunction that declares a Throwable.
|
| public static interface | Functions.
Predicate type 1. O1, Predicate type 2. O2, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
BiPredicate that declares a Throwable.
|
| public static interface | Functions.
Return type. R, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
java. that declares a Throwable.
|
| public static interface | Functions.
Consumed type 1. O, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
Consumer that declares a Throwable.
|
| public static interface | Functions.
Input type 1. I, Return type. R, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
Function that declares a Throwable.
|
| public static interface | Functions.
Predicate type 1. I, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
Predicate that declares a Throwable.
|
| public static interface | Functions.
Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
Runnable that declares a Throwable.
|
| public static interface | Functions.
Return type. R, Thrown exception. T extends Throwable>
Deprecated
Use A functional interface like org..
Supplier that declares a Throwable.
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type of the first argument the consumer accepts O1, the type of the second argument the consumer accepts O2, the type of checked exception the consumer may throw T extends Throwable> void | accept(final Functions.
the consumer to consume consumer,the first object to consume by object1, final O2 consumerthe second object to consume by object2)consumer
References Deprecated
Functions.FailableBiConsumer is deprecated or references (maybe indirectly) at least one deprecated element.
Consumes a consumer and rethrows any exception as a |
| public static < the type the consumer accepts O, the type of checked exception the consumer may throw T extends Throwable> void | accept(final Functions.
the consumer to consume consumer,the object to consume by object)consumer
References Deprecated
Functions.FailableConsumer is deprecated or references (maybe indirectly) at least one deprecated element.
Consumes a consumer and rethrows any exception as a |
| public static < the type of the first argument the function accepts O1, the type of the second argument the function accepts O2, the return type of the function O, the type of checked exception the function may throw T extends Throwable> O | Returns: the value returned from the functionthe function to apply function,the first input to apply input1, final O2 function onthe second input to apply input2)function on
References Deprecated
Functions.FailableBiFunction is deprecated or references (maybe indirectly) at least one deprecated element.
Applies a function and rethrows any exception as a |
| public static < the type of the argument the function accepts I, the return type of the function O, the type of checked exception the function may throw T extends Throwable> O | Returns: the value returned from the functionthe function to apply function,the input to apply input)function on
References Deprecated
Functions.FailableFunction is deprecated or references (maybe indirectly) at least one deprecated element.
Applies a function and rethrows any exception as a |
| public static < the type of the first argument of the consumers O1, the type of the second argument of the consumers O2> BiConsumer | Returns: a standardBiConsumera failable consumerBiConsumer
References Deprecated
Functions.FailableBiConsumer is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the type of the first argument of the input of the functions O1, the type of the second argument of the input of the functions O2, the type of the output of the functions O> BiFunction | Returns: a standardBiFunction
References Deprecated
Functions.FailableBiFunction is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the type of the first argument used by the predicates O1, the type of the second argument used by the predicates O2> BiPredicate | Returns: a standardBiPredicate
References Deprecated
Functions.FailableBiPredicate is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the type used by the callables O> Callable | Returns: a standardCallable
References Deprecated
Functions.FailableCallable is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the type used by the consumers I> Consumer | Returns: a standardConsumer
References Deprecated
Functions.FailableConsumer is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the type of the input of the functions I, the type of the output of the functions O> Function | Returns: a standardFunctiona {code FailableFunction} function
References Deprecated
Functions.FailableFunction is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the type used by the predicates I> Predicate | Returns: a standardPredicate
References Deprecated
Functions.FailablePredicate is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static Runnable | Returns: a standardRunnable
References Deprecated
Functions.FailableRunnable is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the type supplied by the suppliers O> Supplier | Returns: a standardSupplier
References Deprecated
Functions.FailableSupplier is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given |
| public static < the return type of the callable O, the type of checked exception the callable may throw T extends Throwable> O | Returns: the value returned from the callablethe callable to call callable
References Deprecated
Functions.FailableCallable is deprecated or references (maybe indirectly) at least one deprecated element.
Calls a callable and rethrows any exception as a |
| public static < The suppliers output type. O, The type of checked exception, which the supplier can throw. T extends Throwable> O | Returns: The object, which has been created by the supplierThe supplier to invoke. supplier
References Deprecated
Functions.FailableSupplier is deprecated or references (maybe indirectly) at least one deprecated element.
Invokes a supplier, and returns the result. |
| private static < The type of checked exception, which the supplier can throw. T extends Throwable> boolean | Returns: The boolean, which has been created by the supplierThe boolean supplier to invoke. supplier)Invokes a boolean supplier, and returns the result. |
| public static RuntimeException | |
| public static < the type of checked exception the runnable may throw T extends Throwable> void | run(final Functions.
The runnable to run runnable
References Deprecated
Functions.FailableRunnable is deprecated or references (maybe indirectly) at least one deprecated element.
Runs a runnable and rethrows any exception as a |
| public static < The collections element type. (In turn, the result streams element type.) O> Streams. | Returns: The createdFailableStream.The collection, which is being converted into a collection)FailableStream.
References Deprecated
Streams.FailableStream is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given collection into a |
| public static < The streams element type. O> Streams. | Returns: The createdFailableStream.The stream, which is being converted into a stream)FailableStream.
References Deprecated
Streams.FailableStream is deprecated or references (maybe indirectly) at least one deprecated element.
Converts the given stream into a |
| public static < the type of the first argument the predicate tests O1, the type of the second argument the predicate tests O2, the type of checked exception the predicate may throw T extends Throwable> boolean | Returns: the boolean value returned by the predicatethe predicate to test predicate,the first input to test by object1, final O2 predicatethe second input to test by object2)predicate
References Deprecated
Functions.FailableBiPredicate is deprecated or references (maybe indirectly) at least one deprecated element.
Tests a predicate and rethrows any exception as a |
| public static < the type of argument the predicate tests O, the type of checked exception the predicate may throw T extends Throwable> boolean | Returns: the boolean value returned by the predicatethe predicate to test predicate,the input to test by object)predicate
References Deprecated
Functions.FailablePredicate is deprecated or references (maybe indirectly) at least one deprecated element.
Tests a predicate and rethrows any exception as a |
| public static void | tryWithResources(final Functions.
The action to execute. This object will always be invoked. action,An optional error handler, which will be invoked finally, if any error occurred. The error
handler will receive the first error, AKA errorHandler,Throwable.The resource actions to execute. All resource actions will be invoked, in the given
order. A resource action is an instance of resourcesFailableRunnable, which will be executed.
References Deprecated
Functions.FailableRunnable and Functions.FailableConsumer are deprecated or reference (maybe indirectly) at least one deprecated element.
A simple try-with-resources implementation, that can be used, if your objects do not implement the
|
| public static void | tryWithResources(final Functions.
The action to execute. This object will always be invoked. action,The resource actions to execute. All resource actions will be invoked, in the given
order. A resource action is an instance of resourcesFailableRunnable, which will be executed.
References Deprecated
Functions.FailableRunnable is deprecated or references (maybe indirectly) at least one deprecated element.
A simple try-with-resources implementation, that can be used, if your objects do not implement the
|