Package com.landawn.abacus.util
Class Throwables
- java.lang.Object
-
- com.landawn.abacus.util.Throwables
-
- Type Parameters:
T
-
public final class Throwables extends Object
Catch checked exception and convert it toRuntimeException
.- Since:
- 0.8
- Author:
- Haiyang Li
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Throwables.BiConsumer<T,U,E extends Throwable>
The Interface BiConsumer.static interface
Throwables.BiFunction<T,U,R,E extends Throwable>
The Interface BiFunction.static interface
Throwables.BinaryOperator<T,E extends Throwable>
The Interface BinaryOperator.static interface
Throwables.BiPredicate<T,U,E extends Throwable>
The Interface BiPredicate.static interface
Throwables.BooleanBiConsumer<E extends Throwable>
The Interface BooleanBiConsumer.static interface
Throwables.BooleanBiFunction<R,E extends Throwable>
The Interface BooleanBiFunction.static interface
Throwables.BooleanBinaryOperator<E extends Throwable>
The Interface BooleanBinaryOperator.static interface
Throwables.BooleanBiPredicate<E extends Throwable>
The Interface BooleanBiPredicate.static interface
Throwables.BooleanConsumer<E extends Throwable>
The Interface BooleanConsumer.static interface
Throwables.BooleanFunction<R,E extends Throwable>
The Interface BooleanFunction.static interface
Throwables.BooleanPredicate<E extends Throwable>
The Interface BooleanPredicate.static interface
Throwables.BooleanSupplier<E extends Throwable>
The Interface BooleanSupplier.static interface
Throwables.BooleanTernaryOperator<E extends Throwable>
The Interface BooleanTernaryOperator.static interface
Throwables.BooleanTriConsumer<E extends Throwable>
The Interface BooleanTriConsumer.static interface
Throwables.BooleanTriFunction<R,E extends Throwable>
The Interface BooleanTriFunction.static interface
Throwables.BooleanTriPredicate<E extends Throwable>
The Interface BooleanTriPredicate.static interface
Throwables.BooleanUnaryOperator<E extends Throwable>
The Interface BooleanUnaryOperator.static interface
Throwables.ByteBiConsumer<E extends Throwable>
The Interface ByteBiConsumer.static interface
Throwables.ByteBiFunction<R,E extends Throwable>
The Interface ByteBiFunction.static interface
Throwables.ByteBinaryOperator<E extends Throwable>
The Interface ByteBinaryOperator.static interface
Throwables.ByteBiPredicate<E extends Throwable>
The Interface ByteBiPredicate.static interface
Throwables.ByteConsumer<E extends Throwable>
The Interface ByteConsumer.static interface
Throwables.ByteFunction<R,E extends Throwable>
The Interface ByteFunction.static interface
Throwables.BytePredicate<E extends Throwable>
The Interface BytePredicate.static interface
Throwables.ByteSupplier<E extends Throwable>
The Interface ByteSupplier.static interface
Throwables.ByteTernaryOperator<E extends Throwable>
The Interface ByteTernaryOperator.static interface
Throwables.ByteTriConsumer<E extends Throwable>
The Interface ByteTriConsumer.static interface
Throwables.ByteTriFunction<R,E extends Throwable>
The Interface ByteTriFunction.static interface
Throwables.ByteTriPredicate<E extends Throwable>
The Interface ByteTriPredicate.static interface
Throwables.ByteUnaryOperator<E extends Throwable>
The Interface ByteUnaryOperator.static interface
Throwables.Callable<R,E extends Throwable>
The Interface Callable.static interface
Throwables.CharBiConsumer<E extends Throwable>
The Interface CharBiConsumer.static interface
Throwables.CharBiFunction<R,E extends Throwable>
The Interface CharBiFunction.static interface
Throwables.CharBinaryOperator<E extends Throwable>
The Interface CharBinaryOperator.static interface
Throwables.CharBiPredicate<E extends Throwable>
The Interface CharBiPredicate.static interface
Throwables.CharConsumer<E extends Throwable>
The Interface CharConsumer.static interface
Throwables.CharFunction<R,E extends Throwable>
The Interface CharFunction.static interface
Throwables.CharPredicate<E extends Throwable>
The Interface CharPredicate.static interface
Throwables.CharSupplier<E extends Throwable>
The Interface CharSupplier.static interface
Throwables.CharTernaryOperator<E extends Throwable>
The Interface CharTernaryOperator.static interface
Throwables.CharTriConsumer<E extends Throwable>
The Interface CharTriConsumer.static interface
Throwables.CharTriFunction<R,E extends Throwable>
The Interface CharTriFunction.static interface
Throwables.CharTriPredicate<E extends Throwable>
The Interface CharTriPredicate.static interface
Throwables.CharUnaryOperator<E extends Throwable>
The Interface CharUnaryOperator.static interface
Throwables.Consumer<T,E extends Throwable>
The Interface Consumer.static interface
Throwables.DoubleBiConsumer<E extends Throwable>
The Interface DoubleBiConsumer.static interface
Throwables.DoubleBiFunction<R,E extends Throwable>
The Interface DoubleBiFunction.static interface
Throwables.DoubleBinaryOperator<E extends Throwable>
The Interface DoubleBinaryOperator.static interface
Throwables.DoubleBiPredicate<E extends Throwable>
The Interface DoubleBiPredicate.static interface
Throwables.DoubleConsumer<E extends Throwable>
The Interface DoubleConsumer.static interface
Throwables.DoubleFunction<R,E extends Throwable>
The Interface DoubleFunction.static interface
Throwables.DoublePredicate<E extends Throwable>
The Interface DoublePredicate.static interface
Throwables.DoubleSupplier<E extends Throwable>
The Interface DoubleSupplier.static interface
Throwables.DoubleTernaryOperator<E extends Throwable>
The Interface DoubleTernaryOperator.static interface
Throwables.DoubleTriConsumer<E extends Throwable>
The Interface DoubleTriConsumer.static interface
Throwables.DoubleTriFunction<R,E extends Throwable>
The Interface DoubleTriFunction.static interface
Throwables.DoubleTriPredicate<E extends Throwable>
The Interface DoubleTriPredicate.static interface
Throwables.DoubleUnaryOperator<E extends Throwable>
The Interface DoubleUnaryOperator.static class
Throwables.EE
static class
Throwables.EEE
The Class EEE.static interface
Throwables.FloatBiConsumer<E extends Throwable>
The Interface FloatBiConsumer.static interface
Throwables.FloatBiFunction<R,E extends Throwable>
The Interface FloatBiFunction.static interface
Throwables.FloatBinaryOperator<E extends Throwable>
The Interface FloatBinaryOperator.static interface
Throwables.FloatBiPredicate<E extends Throwable>
The Interface FloatBiPredicate.static interface
Throwables.FloatConsumer<E extends Throwable>
The Interface FloatConsumer.static interface
Throwables.FloatFunction<R,E extends Throwable>
The Interface FloatFunction.static interface
Throwables.FloatPredicate<E extends Throwable>
The Interface FloatPredicate.static interface
Throwables.FloatSupplier<E extends Throwable>
The Interface FloatSupplier.static interface
Throwables.FloatTernaryOperator<E extends Throwable>
The Interface FloatTernaryOperator.static interface
Throwables.FloatTriConsumer<E extends Throwable>
The Interface FloatTriConsumer.static interface
Throwables.FloatTriFunction<R,E extends Throwable>
The Interface FloatTriFunction.static interface
Throwables.FloatTriPredicate<E extends Throwable>
The Interface FloatTriPredicate.static interface
Throwables.FloatUnaryOperator<E extends Throwable>
The Interface FloatUnaryOperator.static interface
Throwables.Function<T,R,E extends Throwable>
The Interface Function.static interface
Throwables.IndexedBiConsumer<U,T,E extends Throwable>
The Interface IndexedBiConsumer.static interface
Throwables.IndexedBiFunction<U,T,R,E extends Throwable>
The Interface IndexedBiFunction.static interface
Throwables.IndexedBiPredicate<U,T,E extends Throwable>
The Interface IndexedBiPredicate.static interface
Throwables.IndexedBooleanConsumer<E extends Throwable>
The Interface IndexedBooleanConsumer.static interface
Throwables.IndexedByteConsumer<E extends Throwable>
The Interface IndexedByteConsumer.static interface
Throwables.IndexedCharConsumer<E extends Throwable>
The Interface IndexedCharConsumer.static interface
Throwables.IndexedConsumer<T,E extends Throwable>
The Interface IndexedConsumer.static interface
Throwables.IndexedDoubleConsumer<E extends Throwable>
The Interface IndexedDoubleConsumer.static interface
Throwables.IndexedFloatConsumer<E extends Throwable>
The Interface IndexedFloatConsumer.static interface
Throwables.IndexedFunction<T,R,E extends Throwable>
The Interface IndexedFunction.static interface
Throwables.IndexedIntConsumer<E extends Throwable>
The Interface IndexedIntConsumer.static interface
Throwables.IndexedLongConsumer<E extends Throwable>
The Interface IndexedLongConsumer.static interface
Throwables.IndexedPredicate<T,E extends Throwable>
The Interface IndexedPredicate.static interface
Throwables.IndexedShortConsumer<E extends Throwable>
The Interface IndexedShortConsumer.static interface
Throwables.IntBiConsumer<E extends Throwable>
The Interface IntBiConsumer.static interface
Throwables.IntBiFunction<R,E extends Throwable>
The Interface IntBiFunction.static interface
Throwables.IntBinaryOperator<E extends Throwable>
The Interface IntBinaryOperator.static interface
Throwables.IntBiPredicate<E extends Throwable>
The Interface IntBiPredicate.static interface
Throwables.IntConsumer<E extends Throwable>
The Interface IntConsumer.static interface
Throwables.IntFunction<R,E extends Throwable>
The Interface IntFunction.static interface
Throwables.IntPredicate<E extends Throwable>
The Interface IntPredicate.static interface
Throwables.IntSupplier<E extends Throwable>
The Interface IntSupplier.static interface
Throwables.IntTernaryOperator<E extends Throwable>
The Interface IntTernaryOperator.static interface
Throwables.IntTriConsumer<E extends Throwable>
The Interface IntTriConsumer.static interface
Throwables.IntTriFunction<R,E extends Throwable>
The Interface IntTriFunction.static interface
Throwables.IntTriPredicate<E extends Throwable>
The Interface IntTriPredicate.static interface
Throwables.IntUnaryOperator<E extends Throwable>
The Interface IntUnaryOperator.static class
Throwables.LazyInitializer<T,E extends Throwable>
static interface
Throwables.LongBiConsumer<E extends Throwable>
The Interface LongBiConsumer.static interface
Throwables.LongBiFunction<R,E extends Throwable>
The Interface LongBiFunction.static interface
Throwables.LongBinaryOperator<E extends Throwable>
The Interface LongBinaryOperator.static interface
Throwables.LongBiPredicate<E extends Throwable>
The Interface LongBiPredicate.static interface
Throwables.LongConsumer<E extends Throwable>
The Interface LongConsumer.static interface
Throwables.LongFunction<R,E extends Throwable>
The Interface LongFunction.static interface
Throwables.LongPredicate<E extends Throwable>
The Interface LongPredicate.static interface
Throwables.LongSupplier<E extends Throwable>
The Interface LongSupplier.static interface
Throwables.LongTernaryOperator<E extends Throwable>
The Interface LongTernaryOperator.static interface
Throwables.LongTriConsumer<E extends Throwable>
The Interface LongTriConsumer.static interface
Throwables.LongTriFunction<R,E extends Throwable>
The Interface LongTriFunction.static interface
Throwables.LongTriPredicate<E extends Throwable>
The Interface LongTriPredicate.static interface
Throwables.LongUnaryOperator<E extends Throwable>
The Interface LongUnaryOperator.static interface
Throwables.ObjBooleanConsumer<T,E extends Throwable>
The Interface ObjBooleanConsumer.static interface
Throwables.ObjByteConsumer<T,E extends Throwable>
The Interface ObjByteConsumer.static interface
Throwables.ObjCharConsumer<T,E extends Throwable>
The Interface ObjCharConsumer.static interface
Throwables.ObjDoubleConsumer<T,E extends Throwable>
The Interface ObjDoubleConsumer.static interface
Throwables.ObjFloatConsumer<T,E extends Throwable>
The Interface ObjFloatConsumer.static interface
Throwables.ObjIntConsumer<T,E extends Throwable>
The Interface ObjIntConsumer.static interface
Throwables.ObjLongConsumer<T,E extends Throwable>
The Interface ObjLongConsumer.static interface
Throwables.ObjShortConsumer<T,E extends Throwable>
The Interface ObjShortConsumer.static interface
Throwables.Predicate<T,E extends Throwable>
The Interface Predicate.static interface
Throwables.QuadConsumer<A,B,C,D,E extends Throwable>
The Interface QuadConsumer.static interface
Throwables.QuadFunction<A,B,C,D,R,E extends Throwable>
The Interface QuadFunction.static interface
Throwables.QuadPredicate<A,B,C,D,E extends Throwable>
The Interface QuadPredicate.static interface
Throwables.Runnable<E extends Throwable>
The Interface Runnable.static interface
Throwables.ShortBiConsumer<E extends Throwable>
The Interface ShortBiConsumer.static interface
Throwables.ShortBiFunction<R,E extends Throwable>
The Interface ShortBiFunction.static interface
Throwables.ShortBinaryOperator<E extends Throwable>
The Interface ShortBinaryOperator.static interface
Throwables.ShortBiPredicate<E extends Throwable>
The Interface ShortBiPredicate.static interface
Throwables.ShortConsumer<E extends Throwable>
The Interface ShortConsumer.static interface
Throwables.ShortFunction<R,E extends Throwable>
The Interface ShortFunction.static interface
Throwables.ShortPredicate<E extends Throwable>
The Interface ShortPredicate.static interface
Throwables.ShortSupplier<E extends Throwable>
The Interface ShortSupplier.static interface
Throwables.ShortTernaryOperator<E extends Throwable>
The Interface ShortTernaryOperator.static interface
Throwables.ShortTriConsumer<E extends Throwable>
The Interface ShortTriConsumer.static interface
Throwables.ShortTriFunction<R,E extends Throwable>
The Interface ShortTriFunction.static interface
Throwables.ShortTriPredicate<E extends Throwable>
The Interface ShortTriPredicate.static interface
Throwables.ShortUnaryOperator<E extends Throwable>
The Interface ShortUnaryOperator.static interface
Throwables.Supplier<T,E extends Throwable>
The Interface Supplier.static interface
Throwables.TernaryOperator<T,E extends Throwable>
The Interface TernaryOperator.static interface
Throwables.ToBooleanFunction<T,E extends Throwable>
The Interface ToBooleanFunction.static interface
Throwables.ToByteFunction<T,E extends Throwable>
The Interface ToByteFunction.static interface
Throwables.ToCharFunction<T,E extends Throwable>
The Interface ToCharFunction.static interface
Throwables.ToDoubleFunction<T,E extends Throwable>
The Interface ToDoubleFunction.static interface
Throwables.ToFloatFunction<T,E extends Throwable>
The Interface ToFloatFunction.static interface
Throwables.ToIntFunction<T,E extends Throwable>
The Interface ToIntFunction.static interface
Throwables.ToLongFunction<T,E extends Throwable>
The Interface ToLongFunction.static interface
Throwables.ToShortFunction<T,E extends Throwable>
The Interface ToShortFunction.static interface
Throwables.TriConsumer<A,B,C,E extends Throwable>
The Interface TriConsumer.static interface
Throwables.TriFunction<A,B,C,R,E extends Throwable>
The Interface TriFunction.static interface
Throwables.TriPredicate<A,B,C,E extends Throwable>
The Interface TriPredicate.static interface
Throwables.UnaryOperator<T,E extends Throwable>
The Interface UnaryOperator.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R> R
call(Throwables.Callable<R,? extends Throwable> cmd)
static <R> R
call(Throwables.Callable<R,? extends Throwable> cmd, Function<? super Throwable,R> actionOnError)
static <R> R
call(Throwables.Callable<R,? extends Throwable> cmd, Predicate<? super Throwable> predicate, Supplier<R> supplier)
static <R> R
call(Throwables.Callable<R,? extends Throwable> cmd, Predicate<? super Throwable> predicate, R defaultValue)
static <R> R
call(Throwables.Callable<R,? extends Throwable> cmd, Supplier<R> supplier)
static <R> R
call(Throwables.Callable<R,? extends Throwable> cmd, R defaultValue)
static void
run(Throwables.Runnable<? extends Throwable> cmd)
static void
run(Throwables.Runnable<? extends Throwable> cmd, Consumer<? super Throwable> actionOnError)
-
-
-
Method Detail
-
run
public static void run(Throwables.Runnable<? extends Throwable> cmd)
- Parameters:
cmd
-- Throws:
RuntimeException
- if some error happens
-
run
public static void run(Throwables.Runnable<? extends Throwable> cmd, Consumer<? super Throwable> actionOnError)
- Parameters:
cmd
-actionOnError
-
-
call
public static <R> R call(Throwables.Callable<R,? extends Throwable> cmd)
- Type Parameters:
R
-- Parameters:
cmd
-- Returns:
- Throws:
RuntimeException
- if some error happens
-
call
public static <R> R call(Throwables.Callable<R,? extends Throwable> cmd, Function<? super Throwable,R> actionOnError)
- Type Parameters:
R
-- Parameters:
cmd
-actionOnError
-- Returns:
-
call
public static <R> R call(Throwables.Callable<R,? extends Throwable> cmd, Supplier<R> supplier)
- Type Parameters:
R
-- Parameters:
cmd
-supplier
-- Returns:
-
call
public static <R> R call(Throwables.Callable<R,? extends Throwable> cmd, R defaultValue)
- Type Parameters:
R
-- Parameters:
cmd
-defaultValue
-- Returns:
-
call
public static <R> R call(Throwables.Callable<R,? extends Throwable> cmd, Predicate<? super Throwable> predicate, Supplier<R> supplier)
- Type Parameters:
R
-- Parameters:
cmd
-predicate
-supplier
-- Returns:
- Throws:
RuntimeException
- if some error happens andpredicate
return false.
-
call
public static <R> R call(Throwables.Callable<R,? extends Throwable> cmd, Predicate<? super Throwable> predicate, R defaultValue)
- Type Parameters:
R
-- Parameters:
cmd
-predicate
-defaultValue
-- Returns:
- Throws:
RuntimeException
- if some error happens andpredicate
return false.
-
-