diff options
author | Gary Gregory <garydgregory@gmail.com> | 2020-06-12 11:36:13 -0400 |
---|---|---|
committer | Gary Gregory <garydgregory@gmail.com> | 2020-06-12 11:36:13 -0400 |
commit | 540ec09e25a3ec60fbe0a77dfc491475229caba7 (patch) | |
tree | 339a24bd5e4747e9371f710152b14fbbd0cd465b /src/main/java/org/apache/commons/lang3/Functions.java | |
parent | d88f70e8ff3e73981809ddc530c19288c1f092c5 (diff) | |
download | apache-commons-lang-540ec09e25a3ec60fbe0a77dfc491475229caba7.tar.gz |
Sort members.
Diffstat (limited to 'src/main/java/org/apache/commons/lang3/Functions.java')
-rw-r--r-- | src/main/java/org/apache/commons/lang3/Functions.java | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/src/main/java/org/apache/commons/lang3/Functions.java b/src/main/java/org/apache/commons/lang3/Functions.java index ae03211a9..f854f02b7 100644 --- a/src/main/java/org/apache/commons/lang3/Functions.java +++ b/src/main/java/org/apache/commons/lang3/Functions.java @@ -136,6 +136,24 @@ public class Functions { } /** + * A functional interface like {@link BooleanSupplier} that declares a Throwable. + * + * @param <T> Thrown exception. + * @since 3.11 + */ + @FunctionalInterface + public interface FailableBooleanSupplier<T extends Throwable> { + + /** + * Supplies a boolean. + * + * @return a result + * @throws T if the supplier fails + */ + boolean getAsBoolean() throws T; + } + + /** * A functional interface like {@link java.util.concurrent.Callable} that declares a Throwable. * * @param <R> Return type. @@ -173,148 +191,130 @@ public class Functions { } /** - * A functional interface like {@link Function} that declares a Throwable. - * - * @param <I> Input type 1. - * @param <R> Return type. - * @param <T> Thrown exception. - */ - @FunctionalInterface - public interface FailableFunction<I, R, T extends Throwable> { - - /** - * Applies this function. - * - * @param input the input for the function - * @return the result of the function - * @throws T if the function fails - */ - R apply(I input) throws T; - } - - /** - * A functional interface like {@link Predicate} that declares a Throwable. + * A functional interface like {@link DoubleSupplier} that declares a Throwable. * - * @param <I> Predicate type 1. * @param <T> Thrown exception. + * @since 3.11 */ @FunctionalInterface - public interface FailablePredicate<I, T extends Throwable> { + public interface FailableDoubleSupplier<T extends Throwable> { /** - * Tests the predicate. + * Supplies a double. * - * @param object the object to test the predicate on - * @return the predicate's evaluation - * @throws T if the predicate fails + * @return a result + * @throws T if the supplier fails */ - boolean test(I object) throws T; + double getAsDouble() throws T; } /** - * A functional interface like {@link Runnable} that declares a Throwable. + * A functional interface like {@link Function} that declares a Throwable. * + * @param <I> Input type 1. + * @param <R> Return type. * @param <T> Thrown exception. */ @FunctionalInterface - public interface FailableRunnable<T extends Throwable> { + public interface FailableFunction<I, R, T extends Throwable> { /** - * Runs the function. + * Applies this function. * + * @param input the input for the function + * @return the result of the function * @throws T if the function fails */ - void run() throws T; + R apply(I input) throws T; } /** - * A functional interface like {@link Supplier} that declares a Throwable. + * A functional interface like {@link IntSupplier} that declares a Throwable. * - * @param <R> Return type. * @param <T> Thrown exception. + * @since 3.11 */ @FunctionalInterface - public interface FailableSupplier<R, T extends Throwable> { + public interface FailableIntSupplier<T extends Throwable> { /** - * Supplies an object + * Supplies an int. * * @return a result * @throws T if the supplier fails */ - R get() throws T; + int getAsInt() throws T; } /** - * A functional interface like {@link BooleanSupplier} that declares a Throwable. + * A functional interface like {@link LongSupplier} that declares a Throwable. * * @param <T> Thrown exception. * @since 3.11 */ @FunctionalInterface - public interface FailableBooleanSupplier<T extends Throwable> { + public interface FailableLongSupplier<T extends Throwable> { /** - * Supplies a boolean. + * Supplies a long. * * @return a result * @throws T if the supplier fails */ - boolean getAsBoolean() throws T; + long getAsLong() throws T; } /** - * A functional interface like {@link DoubleSupplier} that declares a Throwable. + * A functional interface like {@link Predicate} that declares a Throwable. * + * @param <I> Predicate type 1. * @param <T> Thrown exception. - * @since 3.11 */ @FunctionalInterface - public interface FailableDoubleSupplier<T extends Throwable> { + public interface FailablePredicate<I, T extends Throwable> { /** - * Supplies a double. + * Tests the predicate. * - * @return a result - * @throws T if the supplier fails + * @param object the object to test the predicate on + * @return the predicate's evaluation + * @throws T if the predicate fails */ - double getAsDouble() throws T; + boolean test(I object) throws T; } /** - * A functional interface like {@link IntSupplier} that declares a Throwable. + * A functional interface like {@link Runnable} that declares a Throwable. * * @param <T> Thrown exception. - * @since 3.11 */ @FunctionalInterface - public interface FailableIntSupplier<T extends Throwable> { + public interface FailableRunnable<T extends Throwable> { /** - * Supplies an int. + * Runs the function. * - * @return a result - * @throws T if the supplier fails + * @throws T if the function fails */ - int getAsInt() throws T; + void run() throws T; } /** - * A functional interface like {@link LongSupplier} that declares a Throwable. + * A functional interface like {@link Supplier} that declares a Throwable. * + * @param <R> Return type. * @param <T> Thrown exception. - * @since 3.11 */ @FunctionalInterface - public interface FailableLongSupplier<T extends Throwable> { + public interface FailableSupplier<R, T extends Throwable> { /** - * Supplies a long. + * Supplies an object * * @return a result * @throws T if the supplier fails */ - long getAsLong() throws T; + R get() throws T; } /** |