Package bm.util
Interface ConsumeOrThrow<T>
- Type Parameters:
T- type of value consumed
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A consumer which may throw a
BuildProblemException.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceConsumeOrThrow.CoT<T,E extends Exception> A Consumer which may throw any type ofException. -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic <V,EX extends Exception>
ConsumeOrThrow<V> of(ConsumeOrThrow.CoT<V, EX> cot) Creates a consumer to convert an arbitraryExceptionthrown to aBuildProblemException.
-
Method Details
-
accept
- Throws:
BuildProblemException
-
of
Creates a consumer to convert an arbitraryExceptionthrown to aBuildProblemException.- Type Parameters:
V- the type of value to consumeEX- the exception type to wrap- Parameters:
cot- the consumer throwing an arbitrary exception- Returns:
- a consumer to only throw a
BuildProblemException
-