E
- The extension@FunctionalInterface public interface BooleanSupplierWithThrowable<E extends Throwable> extends BooleanSupplier
Modifier and Type | Method and Description |
---|---|
static <E extends Throwable> |
aBooleanSupplierThatUnsafelyThrowsUnchecked(BooleanSupplierWithThrowable<E> booleansupplierwiththrowable)
Utility method to unwrap lambdas of type BooleanSupplier and withUncheckedThrowable any Exception
|
static <E extends Throwable> |
asBooleanSupplierWithThrowable(BooleanSupplier booleansupplier)
Utility method to convert BooleanSupplierWithThrowable
|
static <E extends Throwable> |
castBooleanSupplierWithThrowable(BooleanSupplierWithThrowable<E> booleansupplierwiththrowable)
Utility method to mark lambdas of type BooleanSupplierWithThrowable
|
default boolean |
getAsBoolean()
Overridden method of BooleanSupplierWithThrowable that will call getAsBooleanWithThrowable, but catching any exceptions.
|
boolean |
getAsBooleanWithThrowable()
Functional method that will throw exceptions.
|
default BooleanSupplierWithThrowable<E> |
onException(Consumer<Throwable> consumer) |
default BooleanSupplier |
thatReturnsOnCatch(boolean defaultReturnValue) |
default BooleanSupplier |
thatUnsafelyThrowsUnchecked() |
default BooleanSupplierWithThrowable<E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default BooleanSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default BooleanSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <E extends Throwable> BooleanSupplierWithThrowable<E> castBooleanSupplierWithThrowable(BooleanSupplierWithThrowable<E> booleansupplierwiththrowable)
E
- The type this interface is allowed to throwbooleansupplierwiththrowable
- The interface instancestatic <E extends Throwable> BooleanSupplier aBooleanSupplierThatUnsafelyThrowsUnchecked(BooleanSupplierWithThrowable<E> booleansupplierwiththrowable) throws E extends Throwable
E
- The type this interface is allowed to throwbooleansupplierwiththrowable
- The interface instanceE
- the original Exception from booleansupplierwiththrowableE extends Throwable
static <E extends Throwable> BooleanSupplierWithThrowable<E> asBooleanSupplierWithThrowable(BooleanSupplier booleansupplier)
E
- The type this interface is allowed to throwbooleansupplier
- The interface instancedefault boolean getAsBoolean()
getAsBoolean
in interface BooleanSupplier
boolean getAsBooleanWithThrowable() throws E extends Throwable
default BooleanSupplier thatReturnsOnCatch(boolean defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default BooleanSupplier thatUnsafelyThrowsUnchecked() throws E extends Throwable
default BooleanSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault BooleanSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault BooleanSupplierWithThrowable<E> withLogging()
default BooleanSupplierWithThrowable<E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.