Thank you Alex! Gary
On Thu, Jun 18, 2020, 07:23 Alex Herbert <alex.d.herb...@gmail.com> wrote: > I've added a skeleton package-info for the new o.a.c.lang3.stream > and o.a.c.lang3.functions packages and fixed the checkstyle issues. The > build should now pass and green light Travis CI. > > I'm not too familiar with how much detail should be in the package info so > this may have to be rewritten. The changes at least get Jenkins builds to > pass again. > > > On Wed, 17 Jun 2020 at 20:58, <ggreg...@apache.org> wrote: > > > This is an automated email from the ASF dual-hosted git repository. > > > > ggregory pushed a commit to branch master > > in repository https://gitbox.apache.org/repos/asf/commons-lang.git > > > > > > The following commit(s) were added to refs/heads/master by this push: > > new 8b54728 Create the new package org.apache.commons.function to > > parallel the JRE's java.util.function to provide home for our "failable" > > version of the JRE's functional interfaces. > > 8b54728 is described below > > > > commit 8b54728564e3e0c75ef915fb17f172326e8be197 > > Author: Gary Gregory <garydgreg...@gmail.com> > > AuthorDate: Wed Jun 17 15:58:26 2020 -0400 > > > > Create the new package org.apache.commons.function to parallel the > > JRE's > > java.util.function to provide home for our "failable" version of the > > JRE's functional interfaces. > > --- > > .../java/org/apache/commons/lang3/Functions.java | 657 +-------------- > > .../lang3/function/FailableBooleanSupplier.java | 38 + > > .../function/FailableDoubleBinaryOperator.java | 40 + > > .../lang3/function/FailableDoubleConsumer.java | 38 + > > .../lang3/function/FailableDoubleFunction.java | 40 + > > .../lang3/function/FailableDoublePredicate.java | 39 + > > .../lang3/function/FailableDoubleSupplier.java | 38 + > > .../function/FailableDoubleToIntFunction.java | 39 + > > .../function/FailableDoubleToLongFunction.java | 39 + > > .../lang3/function/FailableIntBinaryOperator.java | 40 + > > .../lang3/function/FailableIntConsumer.java | 38 + > > .../lang3/function/FailableIntFunction.java | 40 + > > .../lang3/function/FailableIntPredicate.java | 39 + > > .../lang3/function/FailableIntSupplier.java | 38 + > > .../function/FailableIntToDoubleFunction.java | 39 + > > .../lang3/function/FailableIntToLongFunction.java | 39 + > > .../lang3/function/FailableLongBinaryOperator.java | 40 + > > .../lang3/function/FailableLongConsumer.java | 38 + > > .../lang3/function/FailableLongFunction.java | 40 + > > .../lang3/function/FailableLongPredicate.java | 39 + > > .../lang3/function/FailableLongSupplier.java | 38 + > > .../function/FailableLongToDoubleFunction.java | 39 + > > .../lang3/function/FailableLongToIntFunction.java | 39 + > > .../lang3/function/FailableObjDoubleConsumer.java | 40 + > > .../lang3/function/FailableObjIntConsumer.java | 40 + > > .../lang3/function/FailableObjLongConsumer.java | 40 + > > .../lang3/function/FailableToDoubleBiFunction.java | 42 + > > .../lang3/function/FailableToDoubleFunction.java | 40 + > > .../lang3/function/FailableToIntBiFunction.java | 42 + > > .../lang3/function/FailableToIntFunction.java | 40 + > > .../lang3/function/FailableToLongBiFunction.java | 42 + > > .../lang3/function/FailableToLongFunction.java | 40 + > > .../org/apache/commons/lang3/FunctionsTest.java | 908 > > +-------------------- > > .../FailableFunctionsTest.java} | 574 ++++--------- > > 34 files changed, 1414 insertions(+), 1948 deletions(-) > > > > diff --git a/src/main/java/org/apache/commons/lang3/Functions.java > > b/src/main/java/org/apache/commons/lang3/Functions.java > > index 16e7a0c..4aa7209 100644 > > --- a/src/main/java/org/apache/commons/lang3/Functions.java > > +++ b/src/main/java/org/apache/commons/lang3/Functions.java > > @@ -25,44 +25,21 @@ import java.util.concurrent.Callable; > > import java.util.function.BiConsumer; > > import java.util.function.BiFunction; > > import java.util.function.BiPredicate; > > -import java.util.function.BooleanSupplier; > > import java.util.function.Consumer; > > -import java.util.function.DoubleBinaryOperator; > > -import java.util.function.DoubleConsumer; > > -import java.util.function.DoubleFunction; > > -import java.util.function.DoublePredicate; > > -import java.util.function.DoubleSupplier; > > -import java.util.function.DoubleToIntFunction; > > -import java.util.function.DoubleToLongFunction; > > import java.util.function.Function; > > -import java.util.function.IntBinaryOperator; > > -import java.util.function.IntConsumer; > > -import java.util.function.IntFunction; > > -import java.util.function.IntPredicate; > > -import java.util.function.IntSupplier; > > -import java.util.function.IntToDoubleFunction; > > -import java.util.function.IntToLongFunction; > > -import java.util.function.LongBinaryOperator; > > -import java.util.function.LongConsumer; > > -import java.util.function.LongFunction; > > -import java.util.function.LongPredicate; > > -import java.util.function.LongSupplier; > > -import java.util.function.LongToDoubleFunction; > > -import java.util.function.LongToIntFunction; > > -import java.util.function.ObjDoubleConsumer; > > -import java.util.function.ObjIntConsumer; > > -import java.util.function.ObjLongConsumer; > > import java.util.function.Predicate; > > import java.util.function.Supplier; > > -import java.util.function.ToDoubleBiFunction; > > -import java.util.function.ToDoubleFunction; > > -import java.util.function.ToIntBiFunction; > > -import java.util.function.ToIntFunction; > > -import java.util.function.ToLongBiFunction; > > -import java.util.function.ToLongFunction; > > import java.util.stream.Stream; > > > > import org.apache.commons.lang3.Streams.FailableStream; > > +import org.apache.commons.lang3.function.FailableBooleanSupplier; > > +import org.apache.commons.lang3.function.FailableDoubleBinaryOperator; > > +import org.apache.commons.lang3.function.FailableDoubleConsumer; > > +import org.apache.commons.lang3.function.FailableDoubleSupplier; > > +import org.apache.commons.lang3.function.FailableIntConsumer; > > +import org.apache.commons.lang3.function.FailableIntSupplier; > > +import org.apache.commons.lang3.function.FailableLongConsumer; > > +import org.apache.commons.lang3.function.FailableLongSupplier; > > > > /** > > * This class provides utility functions, and classes for working with > > the {@code java.util.function} package, or more > > @@ -101,6 +78,8 @@ public class Functions { > > > > /** > > * A functional interface like {@link BiConsumer} that declares a > > {@code Throwable}. > > + * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > * > > * @param <O1> Consumed type 1. > > * @param <O2> Consumed type 2. > > @@ -122,6 +101,8 @@ public class Functions { > > /** > > * A functional interface like {@link BiFunction} that declares a > > {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <O1> Input type 1. > > * @param <O2> Input type 2. > > * @param <R> Return type. > > @@ -144,6 +125,8 @@ public class Functions { > > /** > > * A functional interface like {@link BiPredicate} that declares a > > {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <O1> Predicate type 1. > > * @param <O2> Predicate type 2. > > * @param <T> Thrown exception. > > @@ -163,26 +146,10 @@ public class Functions { > > } > > > > /** > > - * A functional interface like {@link BooleanSupplier} that declares > > a {@code 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 {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <R> Return type. > > * @param <T> Thrown exception. > > */ > > @@ -201,6 +168,8 @@ public class Functions { > > /** > > * A functional interface like {@link Consumer} that declares a > > {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <O> Consumed type 1. > > * @param <T> Thrown exception. > > */ > > @@ -217,140 +186,10 @@ public class Functions { > > } > > > > /** > > - * A functional interface like {@link DoubleBinaryOperator} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableDoubleBinaryOperator<T extends Throwable> { > > - > > - /** > > - * Applies this operator to the given operands. > > - * > > - * @param left the first operand > > - * @param right the second operand > > - * @return the operator result > > - * @throws T if the operation fails > > - */ > > - double applyAsDouble(double left, double right) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link DoubleConsumer} that declares > a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableDoubleConsumer<T extends Throwable> { > > - > > - /** > > - * Accepts the consumer. > > - * > > - * @param value the parameter for the consumable to accept > > - * @throws T Thrown when the consumer fails. > > - */ > > - void accept(double value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link DoubleFunction} that declares > a > > {@code Throwable}. > > - * > > - * @param <R> Return type. > > - * @param <T> Thrown exception. > > - */ > > - @FunctionalInterface > > - public interface FailableDoubleFunction<R, T extends Throwable> { > > - > > - /** > > - * Applies this function. > > - * > > - * @param input the input for the function > > - * @return the result of the function > > - * @throws T Thrown when the function fails. > > - */ > > - R apply(double input) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link DoublePredicate} that declares > > a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableDoublePredicate<T extends Throwable> { > > - > > - /** > > - * Tests the predicate. > > - * > > - * @param value the parameter for the predicate to accept. > > - * @return {@code true} if the input argument matches the > > predicate, {@code false} otherwise. > > - * @throws T Thrown when the consumer fails. > > - */ > > - boolean test(double value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link DoubleSupplier} that declares > a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableDoubleSupplier<T extends Throwable> { > > - > > - /** > > - * Supplies a double. > > - * > > - * @return a result > > - * @throws T if the supplier fails > > - */ > > - double getAsDouble() throws T; > > - } > > - > > - /** > > - * A functional interface like {@link DoubleToIntFunction} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableDoubleToIntFunction<T extends Throwable> { > > - > > - /** > > - * Applies this function to the given argument. > > - * > > - * @param value the function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - int applyAsInt(double value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link DoubleToLongFunction} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableDoubleToLongFunction<T extends Throwable> { > > - > > - /** > > - * Applies this function to the given argument. > > - * > > - * @param value the function argument > > - * @return the function result > > - * @throws T if the operation fails > > - */ > > - int applyAsLong(double value) throws T; > > - } > > - > > - /** > > * A functional interface like {@link Function} that declares a > > {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <I> Input type 1. > > * @param <R> Return type. > > * @param <T> Thrown exception. > > @@ -369,332 +208,10 @@ public class Functions { > > } > > > > /** > > - * A functional interface like {@link IntBinaryOperator} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableIntBinaryOperator<T extends Throwable> { > > - > > - /** > > - * Applies this operator to the given operands. > > - * > > - * @param left the first operand > > - * @param right the second operand > > - * @return the operator result > > - * @throws T if the operation fails > > - */ > > - int applyAsInt(int left, int right) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link IntConsumer} that declares a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableIntConsumer<T extends Throwable> { > > - > > - /** > > - * Accepts the consumer. > > - * > > - * @param value the parameter for the consumable to accept > > - * @throws T Thrown when the consumer fails. > > - */ > > - void accept(int value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link IntFunction} that declares a > > {@code Throwable}. > > - * > > - * @param <R> Return type. > > - * @param <T> Thrown exception. > > - */ > > - @FunctionalInterface > > - public interface FailableIntFunction<R, T extends Throwable> { > > - > > - /** > > - * Applies this function. > > - * > > - * @param input the input for the function > > - * @return the result of the function > > - * @throws T Thrown when the function fails. > > - */ > > - R apply(int input) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link IntPredicate} that declares a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableIntPredicate<T extends Throwable> { > > - > > - /** > > - * Tests the predicate. > > - * > > - * @param value the parameter for the predicate to accept. > > - * @return {@code true} if the input argument matches the > > predicate, {@code false} otherwise. > > - * @throws T Thrown when the consumer fails. > > - */ > > - boolean test(int value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link IntSupplier} that declares a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableIntSupplier<T extends Throwable> { > > - > > - /** > > - * Supplies an int. > > - * > > - * @return a result > > - * @throws T if the supplier fails > > - */ > > - int getAsInt() throws T; > > - } > > - > > - /** > > - * A functional interface like {@link IntToDoubleFunction} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableIntToDoubleFunction<T extends Throwable> { > > - > > - /** > > - * Applies this function to the given argument. > > - * > > - * @param value the function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - double applyAsDouble(int value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link IntToLongFunction} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableIntToLongFunction<T extends Throwable> { > > - > > - /** > > - * Applies this function to the given argument. > > - * > > - * @param value the function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - long applyAsLong(int value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link LongBinaryOperator} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableLongBinaryOperator<T extends Throwable> { > > - > > - /** > > - * Applies this operator to the given operands. > > - * > > - * @param left the first operand > > - * @param right the second operand > > - * @return the operator result > > - * @throws T if the operation fails > > - */ > > - long applyAsLong(long left, long right) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link LongConsumer} that declares a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableLongConsumer<T extends Throwable> { > > - > > - /** > > - * Accepts the consumer. > > - * > > - * @param object the parameter for the consumable to accept > > - * @throws T Thrown when the consumer fails. > > - */ > > - void accept(long object) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link LongFunction} that declares a > > {@code Throwable}. > > - * > > - * @param <R> Return type. > > - * @param <T> Thrown exception. > > - */ > > - @FunctionalInterface > > - public interface FailableLongFunction<R, T extends Throwable> { > > - > > - /** > > - * Applies this function. > > - * > > - * @param input the input for the function > > - * @return the result of the function > > - * @throws T Thrown when the function fails. > > - */ > > - R apply(long input) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link LongPredicate} that declares a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableLongPredicate<T extends Throwable> { > > - > > - /** > > - * Tests the predicate. > > - * > > - * @param value the parameter for the predicate to accept. > > - * @return {@code true} if the input argument matches the > > predicate, {@code false} otherwise. > > - * @throws T Thrown when the consumer fails. > > - */ > > - boolean test(long value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link LongSupplier} that declares a > > {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableLongSupplier<T extends Throwable> { > > - > > - /** > > - * Supplies a long. > > - * > > - * @return a result > > - * @throws T if the supplier fails > > - */ > > - long getAsLong() throws T; > > - } > > - > > - /** > > - * A functional interface like {@link LongToDoubleFunction} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableLongToDoubleFunction<T extends Throwable> { > > - > > - /** > > - * Applies this function to the given argument. > > - * > > - * @param value the function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - double applyAsDouble(long value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link LongToIntFunction} that > > declares a {@code Throwable}. > > - * > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableLongToIntFunction<T extends Throwable> { > > - > > - /** > > - * Applies this function to the given argument. > > - * > > - * @param value the function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - int applyAsInt(long value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ObjDoubleConsumer} that > > declares a {@code Throwable}. > > - * > > - * @param <O> the type of the object argument to the operation. > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableObjDoubleConsumer<O, T extends Throwable> { > > - > > - /** > > - * Accepts the consumer. > > - * > > - * @param object the object parameter for the consumable to > > accept. > > - * @param value the double parameter for the consumable to > > accept. > > - * @throws T Thrown when the consumer fails. > > - */ > > - void accept(O object, double value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ObjIntConsumer} that declares > a > > {@code Throwable}. > > - * > > - * @param <O> the type of the object argument to the operation. > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableObjIntConsumer<O, T extends Throwable> { > > - > > - /** > > - * Accepts the consumer. > > - * > > - * @param object the object parameter for the consumable to > > accept. > > - * @param value the int parameter for the consumable to accept. > > - * @throws T Thrown when the consumer fails. > > - */ > > - void accept(O object, int value) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ObjLongConsumer} that declares > > a {@code Throwable}. > > - * > > - * @param <O> the type of the object argument to the operation. > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableObjLongConsumer<O, T extends Throwable> { > > - > > - /** > > - * Accepts the consumer. > > - * > > - * @param object the object parameter for the consumable to > > accept. > > - * @param value the long parameter for the consumable to > accept. > > - * @throws T Thrown when the consumer fails. > > - */ > > - void accept(O object, long value) throws T; > > - } > > - > > - /** > > * A functional interface like {@link Predicate} that declares a > > {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <I> Predicate type 1. > > * @param <T> Thrown exception. > > */ > > @@ -714,6 +231,8 @@ public class Functions { > > /** > > * A functional interface like {@link Runnable} that declares a > > {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <T> Thrown exception. > > */ > > @FunctionalInterface > > @@ -730,6 +249,8 @@ public class Functions { > > /** > > * A functional interface like {@link Supplier} that declares a > > {@code Throwable}. > > * > > + * <p>TODO for 4.0: Move to org.apache.commons.lang3.function.</p> > > + * > > * @param <R> Return type. > > * @param <T> Thrown exception. > > */ > > @@ -746,132 +267,6 @@ public class Functions { > > } > > > > /** > > - * A functional interface like {@link ToDoubleBiFunction} that > > declares a {@code Throwable}. > > - * > > - * @param <O1> the type of the first argument to the function > > - * @param <O2> the type of the second argument to the function > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableToDoubleBiFunction<O1, O2, T extends > > Throwable> { > > - > > - /** > > - * Applies this function to the given arguments. > > - * > > - * @param t the first function argument > > - * @param u the second function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - double applyAsDouble(O1 t, O2 u) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ToDoubleFunction} that > declares > > a {@code Throwable}. > > - * > > - * @param <I> the type of the first argument to the function > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableToDoubleFunction<I, T extends Throwable> { > > - > > - /** > > - * Applies this function to the given arguments. > > - * > > - * @param t the first function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - double applyAsDouble(I t) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ToIntBiFunction} that declares > > a {@code Throwable}. > > - * > > - * @param <O1> the type of the first argument to the function > > - * @param <O2> the type of the second argument to the function > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableToIntBiFunction<O1, O2, T extends > Throwable> > > { > > - > > - /** > > - * Applies this function to the given arguments. > > - * > > - * @param t the first function argument > > - * @param u the second function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - int applyAsInt(O1 t, O2 u) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ToIntFunction} that declares a > > {@code Throwable}. > > - * > > - * @param <I> the type of the first argument to the function > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableToIntFunction<I, T extends Throwable> { > > - > > - /** > > - * Applies this function to the given arguments. > > - * > > - * @param t the first function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - int applyAsInt(I t) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ToLongBiFunction} that > declares > > a {@code Throwable}. > > - * > > - * @param <O1> the type of the first argument to the function > > - * @param <O2> the type of the second argument to the function > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableToLongBiFunction<O1, O2, T extends > > Throwable> { > > - > > - /** > > - * Applies this function to the given arguments. > > - * > > - * @param t the first function argument > > - * @param u the second function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - long applyAsLong(O1 t, O2 u) throws T; > > - } > > - > > - /** > > - * A functional interface like {@link ToLongFunction} that declares > a > > {@code Throwable}. > > - * > > - * @param <I> the type of the first argument to the function > > - * @param <T> Thrown exception. > > - * @since 3.11 > > - */ > > - @FunctionalInterface > > - public interface FailableToLongFunction<I, T extends Throwable> { > > - > > - /** > > - * Applies this function to the given arguments. > > - * > > - * @param t the first function argument > > - * @return the function result > > - * @throws T Thrown when the function fails. > > - */ > > - long applyAsLong(I t) throws T; > > - } > > - > > - /** > > * Consumes a consumer and rethrows any exception as a {@link > > RuntimeException}. > > * > > * @param consumer the consumer to consume > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableBooleanSupplier.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableBooleanSupplier.java > > new file mode 100644 > > index 0000000..0deaef5 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableBooleanSupplier.java > > @@ -0,0 +1,38 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.BooleanSupplier; > > + > > +/** > > + * A functional interface like {@link BooleanSupplier} that declares a > > {@code 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; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableDoubleBinaryOperator.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleBinaryOperator.java > > new file mode 100644 > > index 0000000..db58976 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleBinaryOperator.java > > @@ -0,0 +1,40 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.DoubleBinaryOperator; > > + > > +/** > > + * A functional interface like {@link DoubleBinaryOperator} that > declares > > a {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableDoubleBinaryOperator<T extends Throwable> { > > + > > + /** > > + * Applies this operator to the given operands. > > + * > > + * @param left the first operand > > + * @param right the second operand > > + * @return the operator result > > + * @throws T if the operation fails > > + */ > > + double applyAsDouble(double left, double right) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableDoubleConsumer.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleConsumer.java > > new file mode 100644 > > index 0000000..ade6e0c > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleConsumer.java > > @@ -0,0 +1,38 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.DoubleConsumer; > > + > > +/** > > + * A functional interface like {@link DoubleConsumer} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableDoubleConsumer<T extends Throwable> { > > + > > + /** > > + * Accepts the consumer. > > + * > > + * @param value the parameter for the consumable to accept > > + * @throws T Thrown when the consumer fails. > > + */ > > + void accept(double value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableDoubleFunction.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleFunction.java > > new file mode 100644 > > index 0000000..156b204 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleFunction.java > > @@ -0,0 +1,40 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.DoubleFunction; > > + > > +/** > > + * A functional interface like {@link DoubleFunction} that declares a > > {@code Throwable}. > > + * > > + * @param <R> Return type. > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableDoubleFunction<R, T extends Throwable> { > > + > > + /** > > + * Applies this function. > > + * > > + * @param input the input for the function > > + * @return the result of the function > > + * @throws T Thrown when the function fails. > > + */ > > + R apply(double input) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableDoublePredicate.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoublePredicate.java > > new file mode 100644 > > index 0000000..fda8786 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoublePredicate.java > > @@ -0,0 +1,39 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.DoublePredicate; > > + > > +/** > > + * A functional interface like {@link DoublePredicate} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableDoublePredicate<T extends Throwable> { > > + > > + /** > > + * Tests the predicate. > > + * > > + * @param value the parameter for the predicate to accept. > > + * @return {@code true} if the input argument matches the predicate, > > {@code false} otherwise. > > + * @throws T Thrown when the consumer fails. > > + */ > > + boolean test(double value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableDoubleSupplier.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleSupplier.java > > new file mode 100644 > > index 0000000..9fb751b > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleSupplier.java > > @@ -0,0 +1,38 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.DoubleSupplier; > > + > > +/** > > + * A functional interface like {@link DoubleSupplier} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableDoubleSupplier<T extends Throwable> { > > + > > + /** > > + * Supplies a double. > > + * > > + * @return a result > > + * @throws T if the supplier fails > > + */ > > + double getAsDouble() throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableDoubleToIntFunction.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleToIntFunction.java > > new file mode 100644 > > index 0000000..00db9f3 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleToIntFunction.java > > @@ -0,0 +1,39 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.DoubleToIntFunction; > > + > > +/** > > + * A functional interface like {@link DoubleToIntFunction} that declares > > a {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableDoubleToIntFunction<T extends Throwable> { > > + > > + /** > > + * Applies this function to the given argument. > > + * > > + * @param value the function argument > > + * @return the function result > > + * @throws T Thrown when the function fails. > > + */ > > + int applyAsInt(double value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableDoubleToLongFunction.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleToLongFunction.java > > new file mode 100644 > > index 0000000..0eae76c > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableDoubleToLongFunction.java > > @@ -0,0 +1,39 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.DoubleToLongFunction; > > + > > +/** > > + * A functional interface like {@link DoubleToLongFunction} that > declares > > a {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableDoubleToLongFunction<T extends Throwable> { > > + > > + /** > > + * Applies this function to the given argument. > > + * > > + * @param value the function argument > > + * @return the function result > > + * @throws T if the operation fails > > + */ > > + int applyAsLong(double value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableIntBinaryOperator.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntBinaryOperator.java > > new file mode 100644 > > index 0000000..3eaca9d > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntBinaryOperator.java > > @@ -0,0 +1,40 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.IntBinaryOperator; > > + > > +/** > > + * A functional interface like {@link IntBinaryOperator} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableIntBinaryOperator<T extends Throwable> { > > + > > + /** > > + * Applies this operator to the given operands. > > + * > > + * @param left the first operand > > + * @param right the second operand > > + * @return the operator result > > + * @throws T if the operation fails > > + */ > > + int applyAsInt(int left, int right) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableIntConsumer.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntConsumer.java > > new file mode 100644 > > index 0000000..54e7710 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntConsumer.java > > @@ -0,0 +1,38 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.IntConsumer; > > + > > +/** > > + * A functional interface like {@link IntConsumer} that declares a > {@code > > Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableIntConsumer<T extends Throwable> { > > + > > + /** > > + * Accepts the consumer. > > + * > > + * @param value the parameter for the consumable to accept > > + * @throws T Thrown when the consumer fails. > > + */ > > + void accept(int value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableIntFunction.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntFunction.java > > new file mode 100644 > > index 0000000..07e35c6 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntFunction.java > > @@ -0,0 +1,40 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.IntFunction; > > + > > +/** > > + * A functional interface like {@link IntFunction} that declares a > {@code > > Throwable}. > > + * > > + * @param <R> Return type. > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableIntFunction<R, T extends Throwable> { > > + > > + /** > > + * Applies this function. > > + * > > + * @param input the input for the function > > + * @return the result of the function > > + * @throws T Thrown when the function fails. > > + */ > > + R apply(int input) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableIntPredicate.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntPredicate.java > > new file mode 100644 > > index 0000000..40e3877 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntPredicate.java > > @@ -0,0 +1,39 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.IntPredicate; > > + > > +/** > > + * A functional interface like {@link IntPredicate} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableIntPredicate<T extends Throwable> { > > + > > + /** > > + * Tests the predicate. > > + * > > + * @param value the parameter for the predicate to accept. > > + * @return {@code true} if the input argument matches the predicate, > > {@code false} otherwise. > > + * @throws T Thrown when the consumer fails. > > + */ > > + boolean test(int value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableIntSupplier.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntSupplier.java > > new file mode 100644 > > index 0000000..fed9cd2 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntSupplier.java > > @@ -0,0 +1,38 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.IntSupplier; > > + > > +/** > > + * A functional interface like {@link IntSupplier} that declares a > {@code > > Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableIntSupplier<T extends Throwable> { > > + > > + /** > > + * Supplies an int. > > + * > > + * @return a result > > + * @throws T if the supplier fails > > + */ > > + int getAsInt() throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableIntToDoubleFunction.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntToDoubleFunction.java > > new file mode 100644 > > index 0000000..f0d9164 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntToDoubleFunction.java > > @@ -0,0 +1,39 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.IntToDoubleFunction; > > + > > +/** > > + * A functional interface like {@link IntToDoubleFunction} that declares > > a {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableIntToDoubleFunction<T extends Throwable> { > > + > > + /** > > + * Applies this function to the given argument. > > + * > > + * @param value the function argument > > + * @return the function result > > + * @throws T Thrown when the function fails. > > + */ > > + double applyAsDouble(int value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableIntToLongFunction.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntToLongFunction.java > > new file mode 100644 > > index 0000000..f88d5ef > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableIntToLongFunction.java > > @@ -0,0 +1,39 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.IntToLongFunction; > > + > > +/** > > + * A functional interface like {@link IntToLongFunction} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableIntToLongFunction<T extends Throwable> { > > + > > + /** > > + * Applies this function to the given argument. > > + * > > + * @param value the function argument > > + * @return the function result > > + * @throws T Thrown when the function fails. > > + */ > > + long applyAsLong(int value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableLongBinaryOperator.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongBinaryOperator.java > > new file mode 100644 > > index 0000000..e58acf4 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongBinaryOperator.java > > @@ -0,0 +1,40 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.LongBinaryOperator; > > + > > +/** > > + * A functional interface like {@link LongBinaryOperator} that declares > a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableLongBinaryOperator<T extends Throwable> { > > + > > + /** > > + * Applies this operator to the given operands. > > + * > > + * @param left the first operand > > + * @param right the second operand > > + * @return the operator result > > + * @throws T if the operation fails > > + */ > > + long applyAsLong(long left, long right) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableLongConsumer.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongConsumer.java > > new file mode 100644 > > index 0000000..7eb784f > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongConsumer.java > > @@ -0,0 +1,38 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.LongConsumer; > > + > > +/** > > + * A functional interface like {@link LongConsumer} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableLongConsumer<T extends Throwable> { > > + > > + /** > > + * Accepts the consumer. > > + * > > + * @param object the parameter for the consumable to accept > > + * @throws T Thrown when the consumer fails. > > + */ > > + void accept(long object) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableLongFunction.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongFunction.java > > new file mode 100644 > > index 0000000..904f946 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongFunction.java > > @@ -0,0 +1,40 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.LongFunction; > > + > > +/** > > + * A functional interface like {@link LongFunction} that declares a > > {@code Throwable}. > > + * > > + * @param <R> Return type. > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableLongFunction<R, T extends Throwable> { > > + > > + /** > > + * Applies this function. > > + * > > + * @param input the input for the function > > + * @return the result of the function > > + * @throws T Thrown when the function fails. > > + */ > > + R apply(long input) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableLongPredicate.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongPredicate.java > > new file mode 100644 > > index 0000000..259b82e > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongPredicate.java > > @@ -0,0 +1,39 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.LongPredicate; > > + > > +/** > > + * A functional interface like {@link LongPredicate} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableLongPredicate<T extends Throwable> { > > + > > + /** > > + * Tests the predicate. > > + * > > + * @param value the parameter for the predicate to accept. > > + * @return {@code true} if the input argument matches the predicate, > > {@code false} otherwise. > > + * @throws T Thrown when the consumer fails. > > + */ > > + boolean test(long value) throws T; > > +} > > \ No newline at end of file > > diff --git > > > a/src/main/java/org/apache/commons/lang3/function/FailableLongSupplier.java > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongSupplier.java > > new file mode 100644 > > index 0000000..67a1aa4 > > --- /dev/null > > +++ > > > b/src/main/java/org/apache/commons/lang3/function/FailableLongSupplier.java > > @@ -0,0 +1,38 @@ > > +/* > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > + * contributor license agreements. See the NOTICE file distributed with > > + * this work for additional information regarding copyright ownership. > > + * The ASF licenses this file to You under the Apache License, Version > 2.0 > > + * (the "License"); you may not use this file except in compliance with > > + * the License. You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > + > > +package org.apache.commons.lang3.function; > > + > > +import java.util.function.LongSupplier; > > + > > +/** > > + * A functional interface like {@link LongSupplier} that declares a > > {@code Throwable}. > > + * > > + * @param <T> Thrown exception. > > + * @since 3.11 > > + */ > > +@FunctionalInterface > > +public interface FailableLongSupplier<T extends Throwable> { > > + > > + /** > > + * Supplies a long. > > + * > > + * @return a result > > + * @throws T if