Package org.apache.bval.util
Class Exceptions
- java.lang.Object
-
- org.apache.bval.util.Exceptions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Exceptions.FormatArgs
Callback interface that collects format arguments in conditional raise* method variants.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Throwable
causeOf(Throwable t)
Extract cause fromInvocationTargetException
s.static <E extends Exception,C extends Throwable>
Ecreate(BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args)
static <E extends Exception,C extends Throwable>
Ecreate(BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message)
static <E extends Exception>
Ecreate(Function<? super String,? extends E> fn, String format, Object... args)
static <E extends Exception>
Ecreate(Function<? super String,? extends E> fn, Supplier<String> message)
static <E extends Exception,C extends Throwable,R>
Rraise(BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args)
static <E extends Exception,C extends Throwable,R>
Rraise(BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message)
static <E extends Exception,R>
Rraise(Function<? super String,? extends E> fn, String format, Object... args)
static <E extends Exception,R>
Rraise(Function<? super String,? extends E> fn, Supplier<String> message)
static <E extends Exception,C extends Throwable>
voidraiseIf(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args)
static <E extends Exception,C extends Throwable>
voidraiseIf(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Consumer<Exceptions.FormatArgs> argsProvider)
static <E extends Exception,C extends Throwable>
voidraiseIf(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message)
static <E extends Exception>
voidraiseIf(boolean condition, Function<? super String,? extends E> fn, String format, Object... args)
static <E extends Exception>
voidraiseIf(boolean condition, Function<? super String,? extends E> fn, String format, Consumer<Exceptions.FormatArgs> argsProvider)
static <E extends Exception>
voidraiseIf(boolean condition, Function<? super String,? extends E> fn, Supplier<String> message)
static <E extends Exception,C extends Throwable>
voidraiseUnless(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args)
static <E extends Exception,C extends Throwable>
voidraiseUnless(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Consumer<Exceptions.FormatArgs> argsProvider)
static <E extends Exception,C extends Throwable>
voidraiseUnless(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message)
static <E extends Exception>
voidraiseUnless(boolean condition, Function<? super String,? extends E> fn, String format, Object... args)
static <E extends Exception>
voidraiseUnless(boolean condition, Function<? super String,? extends E> fn, String format, Consumer<Exceptions.FormatArgs> argsProvider)
static <E extends Exception>
voidraiseUnless(boolean condition, Function<? super String,? extends E> fn, Supplier<String> message)
-
-
-
Method Detail
-
create
public static <E extends Exception> E create(Function<? super String,? extends E> fn, String format, Object... args)
-
create
public static <E extends Exception,C extends Throwable> E create(BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args)
-
create
public static <E extends Exception> E create(Function<? super String,? extends E> fn, Supplier<String> message)
-
create
public static <E extends Exception,C extends Throwable> E create(BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message)
-
raise
public static <E extends Exception,R> R raise(Function<? super String,? extends E> fn, String format, Object... args) throws E extends Exception
- Throws:
E extends Exception
-
raiseIf
public static <E extends Exception> void raiseIf(boolean condition, Function<? super String,? extends E> fn, String format, Object... args) throws E extends Exception
- Throws:
E extends Exception
-
raiseUnless
public static <E extends Exception> void raiseUnless(boolean condition, Function<? super String,? extends E> fn, String format, Object... args) throws E extends Exception
- Throws:
E extends Exception
-
raise
public static <E extends Exception,R> R raise(Function<? super String,? extends E> fn, Supplier<String> message) throws E extends Exception
- Throws:
E extends Exception
-
raiseIf
public static <E extends Exception> void raiseIf(boolean condition, Function<? super String,? extends E> fn, String format, Consumer<Exceptions.FormatArgs> argsProvider) throws E extends Exception
- Throws:
E extends Exception
-
raiseIf
public static <E extends Exception> void raiseIf(boolean condition, Function<? super String,? extends E> fn, Supplier<String> message) throws E extends Exception
- Throws:
E extends Exception
-
raiseUnless
public static <E extends Exception> void raiseUnless(boolean condition, Function<? super String,? extends E> fn, String format, Consumer<Exceptions.FormatArgs> argsProvider) throws E extends Exception
- Throws:
E extends Exception
-
raiseUnless
public static <E extends Exception> void raiseUnless(boolean condition, Function<? super String,? extends E> fn, Supplier<String> message) throws E extends Exception
- Throws:
E extends Exception
-
raise
public static <E extends Exception,C extends Throwable,R> R raise(BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args) throws E extends Exception
- Throws:
E extends Exception
-
raiseIf
public static <E extends Exception,C extends Throwable> void raiseIf(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args) throws E extends Exception
- Throws:
E extends Exception
-
raiseUnless
public static <E extends Exception,C extends Throwable> void raiseUnless(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Object... args) throws E extends Exception
- Throws:
E extends Exception
-
raise
public static <E extends Exception,C extends Throwable,R> R raise(BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message) throws E extends Exception
- Throws:
E extends Exception
-
raiseIf
public static <E extends Exception,C extends Throwable> void raiseIf(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Consumer<Exceptions.FormatArgs> argsProvider) throws E extends Exception
- Throws:
E extends Exception
-
raiseIf
public static <E extends Exception,C extends Throwable> void raiseIf(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message) throws E extends Exception
- Throws:
E extends Exception
-
raiseUnless
public static <E extends Exception,C extends Throwable> void raiseUnless(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, String format, Consumer<Exceptions.FormatArgs> argsProvider) throws E extends Exception
- Throws:
E extends Exception
-
raiseUnless
public static <E extends Exception,C extends Throwable> void raiseUnless(boolean condition, BiFunction<? super String,? super C,? extends E> fn, C cause, Supplier<String> message) throws E extends Exception
- Throws:
E extends Exception
-
causeOf
public static Throwable causeOf(Throwable t)
Extract cause fromInvocationTargetException
s.- Parameters:
t
- to unwrap- Returns:
- first of t, cause hierarchy not instanceof
InvocationTargetException
-
-