public final class ThrowingHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <I,R,T extends Throwable> |
applyIfNotEmpty(I value,
ThrowingFunction<I,R,T> function)
Tests whether the value is not null, an empty string, an empty collection or a map and transform it using the given function.
|
static <I,R,T extends Throwable> |
applyIfNotEmpty(I value,
ThrowingFunction<I,R,T> consumer,
Supplier<R> orElse)
Tests whether the value is not null, an empty string, an empty collection or a map and transform it using the given function.
|
static <I1,I2,T extends Throwable> |
wrapAsBiConsumer(ThrowingBiConsumer<I1,I2,T> consumer) |
static <I,T extends Throwable> |
wrapAsConsumer(ThrowingConsumer<I,T> consumer) |
static <I,R,T extends Throwable> |
wrapAsFunction(ThrowingFunction<I,R,T> function) |
static <V,T extends Throwable> |
wrapAsSupplier(ThrowingSupplier<V,T> supplier) |
public static <V,T extends Throwable> Supplier<V> wrapAsSupplier(ThrowingSupplier<V,T> supplier)
public static <I,T extends Throwable> Consumer<I> wrapAsConsumer(ThrowingConsumer<I,T> consumer)
public static <I1,I2,T extends Throwable> BiConsumer<I1,I2> wrapAsBiConsumer(ThrowingBiConsumer<I1,I2,T> consumer)
public static <I,R,T extends Throwable> Function<I,R> wrapAsFunction(ThrowingFunction<I,R,T> function)
public static <I,R,T extends Throwable> Optional<R> applyIfNotEmpty(I value, ThrowingFunction<I,R,T> function) throws T extends Throwable
value - the value, if its a String it will be tested for text length as wellfunction - the function to be executed against value if not emptyT extends Throwablepublic static <I,R,T extends Throwable> R applyIfNotEmpty(I value, ThrowingFunction<I,R,T> consumer, Supplier<R> orElse) throws T extends Throwable
value - the value, if its a String it will be tested for text length as wellconsumer - the function to be executed against value if not emptyorElse - the supplier to use to retrieve a result if the given value is emptyT extends ThrowableApache Camel