E - The extension@FunctionalInterface public interface IntSupplierWithThrowable<E extends Throwable> extends IntSupplier
| Modifier and Type | Method and Description |
|---|---|
static <E extends Throwable> |
aIntSupplierThatUnsafelyThrowsUnchecked(IntSupplierWithThrowable<E> intsupplierwiththrowable)
Utility method to unwrap lambdas of type IntSupplier and withUncheckedThrowable any Exception
|
static <E extends Throwable> |
asIntSupplierWithThrowable(IntSupplier intsupplier)
Utility method to convert IntSupplierWithThrowable
|
static <E extends Throwable> |
castIntSupplierWithThrowable(IntSupplierWithThrowable<E> intsupplierwiththrowable)
Utility method to mark lambdas of type IntSupplierWithThrowable
|
default int |
getAsInt()
Overridden method of IntSupplierWithThrowable that will call getAsIntWithThrowable, but catching any exceptions.
|
int |
getAsIntWithThrowable()
Functional method that will throw exceptions.
|
default IntSupplierWithThrowable<E> |
onException(Consumer<Throwable> consumer) |
default IntSupplier |
thatReturnsOnCatch(int defaultReturnValue) |
default IntSupplier |
thatUnsafelyThrowsUnchecked() |
default IntSupplierWithThrowable<E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default IntSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default IntSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <E extends Throwable> IntSupplierWithThrowable<E> castIntSupplierWithThrowable(IntSupplierWithThrowable<E> intsupplierwiththrowable)
E - The type this interface is allowed to throwintsupplierwiththrowable - The interface instancestatic <E extends Throwable> IntSupplier aIntSupplierThatUnsafelyThrowsUnchecked(IntSupplierWithThrowable<E> intsupplierwiththrowable) throws E extends Throwable
E - The type this interface is allowed to throwintsupplierwiththrowable - The interface instanceE - the original Exception from intsupplierwiththrowableE extends Throwablestatic <E extends Throwable> IntSupplierWithThrowable<E> asIntSupplierWithThrowable(IntSupplier intsupplier)
E - The type this interface is allowed to throwintsupplier - The interface instancedefault int getAsInt()
getAsInt in interface IntSupplierint getAsIntWithThrowable()
throws E extends Throwable
default IntSupplier thatReturnsOnCatch(int defaultReturnValue)
defaultReturnValue - A value to return if any throwable is caught.default IntSupplier thatUnsafelyThrowsUnchecked() throws E extends Throwable
default IntSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger, String message)
logger - The logger to log exceptions onmessage - A message to use for logging exceptionsdefault IntSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger)
logger - The logger instance to log exceptions ondefault IntSupplierWithThrowable<E> withLogging()
default IntSupplierWithThrowable<E> onException(Consumer<Throwable> consumer)
consumer - An exception consumer.Copyright © 2017. All rights reserved.