public class ExceptionFactoryExtended extends Object implements ExceptionFactory
DEFAULT
Constructor and Description |
---|
ExceptionFactoryExtended(ExceptionFactory factory,
Predicate<? super Response> predicate,
Function<? super Response,? extends RuntimeException> function) |
Modifier and Type | Method and Description |
---|---|
Optional<? extends RuntimeException> |
create(Response response)
Returns a
RuntimeException (or subclass) if the response error
condition is met (usually {@code ! |
public ExceptionFactoryExtended(ExceptionFactory factory, Predicate<? super Response> predicate, Function<? super Response,? extends RuntimeException> function)
public Optional<? extends RuntimeException> create(Response response)
ExceptionFactory
RuntimeException
(or subclass) if the response error
condition is met (usually !response.isOk()
. If no exception to be
thrown then returns Optional.empty()
.create
in interface ExceptionFactory
response
- response to map into exceptionCopyright © 2021–2024. All rights reserved.