Package com.gengoai.function
Interface Unchecked
-
public interface Unchecked
Wrappers to turn Checked functional classes into unchecked by throwing a Runtime exception.
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T,U>
SerializableBiConsumer<T,U>biConsumer(CheckedBiConsumer<T,U> checked)
Generates a version of BiConsumer that will capture exceptions and rethrow them as runtime exceptionsstatic <T,U,R>
SerializableBiFunction<T,U,R>biFunction(CheckedBiFunction<T,U,R> checked)
Generates a version of BiFunction that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableBinaryOperator<T>
binaryOperator(CheckedBinaryOperator<T> checked)
Generates a version of BinaryOperator that will capture exceptions and rethrow them as runtime exceptionsstatic <T,U>
SerializableBiPredicate<T,U>biPredicate(CheckedBiPredicate<T,U> checked)
Generates a version of BiPredicate that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableBooleanSupplier
booleanSupplier(CheckedBooleanSupplier checked)
Generates a version of BooleanSupplier that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableConsumer<T>
consumer(CheckedConsumer<T> checked)
Generates a version of Consumer that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableConsumer<T>
consumer(CheckedConsumer<T> consumer, SerializableFunction<Throwable,Throwable> throwableHandler)
static SerializableDoubleBinaryOperator
doubleBinaryOperator(CheckedDoubleBinaryOperator checked)
Generates a version of DoubleBinaryOperator that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableDoubleConsumer
doubleConsumer(CheckedDoubleConsumer checked)
Generates a version of DoubleConsumer that will capture exceptions and rethrow them as runtime exceptionsstatic <R> SerializableDoubleFunction<R>
doubleFunction(CheckedDoubleFunction<R> checked)
Generates a version of DoubleFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableDoublePredicate
doublePredicate(CheckedDoublePredicate checked)
Generates a version of DoublePredicate that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableDoubleSupplier
doubleSupplier(CheckedDoubleSupplier checked)
Generates a version of DoubleSupplier that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableDoubleToIntFunction
doubleToIntFunction(CheckedDoubleToIntFunction checked)
Generates a version of DoubleToIntFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableDoubleToLongFunction
doubleToLongFunction(CheckedDoubleToLongFunction checked)
Generates a version of DoubleToLongFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableDoubleUnaryOperator
doubleUnaryOperator(CheckedDoubleUnaryOperator checked)
Generates a version of DoubleUnaryOperator that will capture exceptions and rethrow them as runtime exceptionsstatic <T,R>
SerializableFunction<T,R>function(CheckedFunction<T,R> checked)
Generates a version of Function that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableIntBinaryOperator
intBinaryOperator(CheckedIntBinaryOperator checked)
Generates a version of IntBinaryOperator that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableIntConsumer
intConsumer(CheckedIntConsumer checked)
Generates a version of IntConsumer that will capture exceptions and rethrow them as runtime exceptionsstatic <R> SerializableIntFunction<R>
intFunction(CheckedIntFunction<R> checked)
Generates a version of IntFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableIntPredicate
intPredicate(CheckedIntPredicate checked)
Generates a version of IntPredicate that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableIntSupplier
intSupplier(CheckedIntSupplier checked)
Generates a version of IntSupplier that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableIntToDoubleFunction
intToDoubleFunction(CheckedIntToDoubleFunction checked)
Generates a version of IntToDoubleFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableIntToLongFunction
intToLongFunction(CheckedIntToLongFunction checked)
Generates a version of IntToLongFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableIntUnaryOperator
intUnaryOperator(CheckedIntUnaryOperator checked)
Generates a version of IntUnaryOperator that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableLongBinaryOperator
longBinaryOperator(CheckedLongBinaryOperator checked)
Generates a version of LongBinaryOperator that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableLongConsumer
longConsumer(CheckedLongConsumer checked)
Generates a version of LongConsumer that will capture exceptions and rethrow them as runtime exceptionsstatic <R> LongFunction<R>
longFunction(CheckedLongFunction<R> checked)
Generates a version of LongFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableLongPredicate
longPredicate(CheckedLongPredicate checked)
Generates a version of LongPredicate that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableLongSupplier
longSupplier(CheckedLongSupplier checked)
Generates a version of LongSupplier that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableLongToDoubleFunction
longToDoubleFunction(CheckedLongToDoubleFunction checked)
Generates a version of LongToDoubleFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableLongToIntFunction
longToIntFunction(CheckedLongToIntFunction checked)
Generates a version of LongToIntFunction that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableLongUnaryOperator
longUnaryOperator(CheckedLongUnaryOperator checked)
Generates a version of LongUnaryOperator that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableObjDoubleConsumer<T>
objDoubleConsumer(CheckedObjDoubleConsumer<T> checked)
Generates a version of ObjDoubleConsumer that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableObjIntConsumer<T>
objIntConsumer(CheckedObjIntConsumer<T> checked)
Generates a version of ObjIntConsumer that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableObjLongConsumer<T>
objLongConsumer(CheckedObjLongConsumer<T> checked)
Generates a version of ObjLongConsumer that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializablePredicate<T>
predicate(CheckedPredicate<T> checked)
Generates a version of Predicate that will capture exceptions and rethrow them as runtime exceptionsstatic SerializableRunnable
runnable(CheckedRunnable runnable)
static <E extends Throwable>
voidsneakyThrow(Throwable throwable)
static <T> SerializableSupplier<T>
supplier(CheckedSupplier<T> checked)
Generates a version of Supplier that will capture exceptions and rethrow them as runtime exceptionsstatic void
throwChecked(Throwable throwable)
static <T,U>
SerializableToDoubleBiFunction<T,U>toDoubleBiFunction(CheckedToDoubleBiFunction<T,U> checked)
Generates a version of ToDoubleBiFunction that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableToDoubleFunction<T>
toDoubleFunction(CheckedToDoubleFunction<T> checked)
Generates a version of ToDoubleFunction that will capture exceptions and rethrow them as runtime exceptionsstatic <T,U>
SerializableToIntBiFunction<T,U>toIntBiFunction(CheckedToIntBiFunction<T,U> checked)
Generates a version of ToIntBiFunction that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableToIntFunction<T>
toIntFunction(CheckedToIntFunction<T> checked)
Generates a version of ToIntFunction that will capture exceptions and rethrow them as runtime exceptionsstatic <T,U>
SerializableToLongBiFunction<T,U>toLongBiFunction(CheckedToLongBiFunction<T,U> checked)
Generates a version of ToLongBiFunction that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableToLongFunction<T>
toLongFunction(CheckedToLongFunction<T> checked)
Generates a version of ToLongFunction that will capture exceptions and rethrow them as runtime exceptionsstatic <T> SerializableUnaryOperator<T>
unaryOperator(CheckedUnaryOperator<T> checked)
Generates a version of UnaryOperator that will capture exceptions and rethrow them as runtime exceptions
-
-
-
Method Detail
-
consumer
static <T> SerializableConsumer<T> consumer(CheckedConsumer<T> consumer, SerializableFunction<Throwable,Throwable> throwableHandler)
-
throwChecked
static void throwChecked(Throwable throwable)
-
sneakyThrow
static <E extends Throwable> void sneakyThrow(Throwable throwable) throws E extends Throwable
- Throws:
E extends Throwable
-
runnable
static SerializableRunnable runnable(CheckedRunnable runnable)
-
doubleToIntFunction
static SerializableDoubleToIntFunction doubleToIntFunction(CheckedDoubleToIntFunction checked)
Generates a version of DoubleToIntFunction that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intToDoubleFunction
static SerializableIntToDoubleFunction intToDoubleFunction(CheckedIntToDoubleFunction checked)
Generates a version of IntToDoubleFunction that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
consumer
static <T> SerializableConsumer<T> consumer(CheckedConsumer<T> checked)
Generates a version of Consumer that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intPredicate
static SerializableIntPredicate intPredicate(CheckedIntPredicate checked)
Generates a version of IntPredicate that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
objLongConsumer
static <T> SerializableObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> checked)
Generates a version of ObjLongConsumer that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
biPredicate
static <T,U> SerializableBiPredicate<T,U> biPredicate(CheckedBiPredicate<T,U> checked)
Generates a version of BiPredicate that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameterU
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
doubleUnaryOperator
static SerializableDoubleUnaryOperator doubleUnaryOperator(CheckedDoubleUnaryOperator checked)
Generates a version of DoubleUnaryOperator that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intUnaryOperator
static SerializableIntUnaryOperator intUnaryOperator(CheckedIntUnaryOperator checked)
Generates a version of IntUnaryOperator that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longUnaryOperator
static SerializableLongUnaryOperator longUnaryOperator(CheckedLongUnaryOperator checked)
Generates a version of LongUnaryOperator that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
booleanSupplier
static SerializableBooleanSupplier booleanSupplier(CheckedBooleanSupplier checked)
Generates a version of BooleanSupplier that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intSupplier
static SerializableIntSupplier intSupplier(CheckedIntSupplier checked)
Generates a version of IntSupplier that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intBinaryOperator
static SerializableIntBinaryOperator intBinaryOperator(CheckedIntBinaryOperator checked)
Generates a version of IntBinaryOperator that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
objIntConsumer
static <T> SerializableObjIntConsumer<T> objIntConsumer(CheckedObjIntConsumer<T> checked)
Generates a version of ObjIntConsumer that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longBinaryOperator
static SerializableLongBinaryOperator longBinaryOperator(CheckedLongBinaryOperator checked)
Generates a version of LongBinaryOperator that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
unaryOperator
static <T> SerializableUnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> checked)
Generates a version of UnaryOperator that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
binaryOperator
static <T> SerializableBinaryOperator<T> binaryOperator(CheckedBinaryOperator<T> checked)
Generates a version of BinaryOperator that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
predicate
static <T> SerializablePredicate<T> predicate(CheckedPredicate<T> checked)
Generates a version of Predicate that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
toDoubleFunction
static <T> SerializableToDoubleFunction<T> toDoubleFunction(CheckedToDoubleFunction<T> checked)
Generates a version of ToDoubleFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
supplier
static <T> SerializableSupplier<T> supplier(CheckedSupplier<T> checked)
Generates a version of Supplier that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
toDoubleBiFunction
static <T,U> SerializableToDoubleBiFunction<T,U> toDoubleBiFunction(CheckedToDoubleBiFunction<T,U> checked)
Generates a version of ToDoubleBiFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameterU
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longPredicate
static SerializableLongPredicate longPredicate(CheckedLongPredicate checked)
Generates a version of LongPredicate that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
biConsumer
static <T,U> SerializableBiConsumer<T,U> biConsumer(CheckedBiConsumer<T,U> checked)
Generates a version of BiConsumer that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameterU
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longSupplier
static SerializableLongSupplier longSupplier(CheckedLongSupplier checked)
Generates a version of LongSupplier that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
toLongFunction
static <T> SerializableToLongFunction<T> toLongFunction(CheckedToLongFunction<T> checked)
Generates a version of ToLongFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intFunction
static <R> SerializableIntFunction<R> intFunction(CheckedIntFunction<R> checked)
Generates a version of IntFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
R
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intConsumer
static SerializableIntConsumer intConsumer(CheckedIntConsumer checked)
Generates a version of IntConsumer that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
biFunction
static <T,U,R> SerializableBiFunction<T,U,R> biFunction(CheckedBiFunction<T,U,R> checked)
Generates a version of BiFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameterU
- Functional parameterR
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longToDoubleFunction
static SerializableLongToDoubleFunction longToDoubleFunction(CheckedLongToDoubleFunction checked)
Generates a version of LongToDoubleFunction that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
doubleBinaryOperator
static SerializableDoubleBinaryOperator doubleBinaryOperator(CheckedDoubleBinaryOperator checked)
Generates a version of DoubleBinaryOperator that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longFunction
static <R> LongFunction<R> longFunction(CheckedLongFunction<R> checked)
Generates a version of LongFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
R
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longToIntFunction
static SerializableLongToIntFunction longToIntFunction(CheckedLongToIntFunction checked)
Generates a version of LongToIntFunction that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
toLongBiFunction
static <T,U> SerializableToLongBiFunction<T,U> toLongBiFunction(CheckedToLongBiFunction<T,U> checked)
Generates a version of ToLongBiFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameterU
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
doublePredicate
static SerializableDoublePredicate doublePredicate(CheckedDoublePredicate checked)
Generates a version of DoublePredicate that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
doubleFunction
static <R> SerializableDoubleFunction<R> doubleFunction(CheckedDoubleFunction<R> checked)
Generates a version of DoubleFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
R
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
longConsumer
static SerializableLongConsumer longConsumer(CheckedLongConsumer checked)
Generates a version of LongConsumer that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
function
static <T,R> SerializableFunction<T,R> function(CheckedFunction<T,R> checked)
Generates a version of Function that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameterR
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
doubleToLongFunction
static SerializableDoubleToLongFunction doubleToLongFunction(CheckedDoubleToLongFunction checked)
Generates a version of DoubleToLongFunction that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
doubleConsumer
static SerializableDoubleConsumer doubleConsumer(CheckedDoubleConsumer checked)
Generates a version of DoubleConsumer that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
intToLongFunction
static SerializableIntToLongFunction intToLongFunction(CheckedIntToLongFunction checked)
Generates a version of IntToLongFunction that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
toIntFunction
static <T> SerializableToIntFunction<T> toIntFunction(CheckedToIntFunction<T> checked)
Generates a version of ToIntFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
doubleSupplier
static SerializableDoubleSupplier doubleSupplier(CheckedDoubleSupplier checked)
Generates a version of DoubleSupplier that will capture exceptions and rethrow them as runtime exceptions- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
toIntBiFunction
static <T,U> SerializableToIntBiFunction<T,U> toIntBiFunction(CheckedToIntBiFunction<T,U> checked)
Generates a version of ToIntBiFunction that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameterU
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
objDoubleConsumer
static <T> SerializableObjDoubleConsumer<T> objDoubleConsumer(CheckedObjDoubleConsumer<T> checked)
Generates a version of ObjDoubleConsumer that will capture exceptions and rethrow them as runtime exceptions- Type Parameters:
T
- Functional parameter- Parameters:
checked
- The checked functional- Returns:
- The checked functional.
-
-