Interface ResponseLogLevelMapper
- All Superinterfaces:
Function<RequestLog,
LogLevel>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@UnstableApi
@FunctionalInterface
public interface ResponseLogLevelMapper
extends Function<RequestLog,LogLevel>
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <V> Function
<RequestLog, V> Deprecated.Do not use this method.apply
(RequestLog log) Returns aLogLevel
for the givenRequestLog
.compose
(Function<? super V, ? extends RequestLog> before) Deprecated.Do not use this method.static ResponseLogLevelMapper
of
(HttpStatusClass statusClass, LogLevel logLevel) Creates a newResponseLogLevelMapper
which returns the specifiedLogLevel
if the givenRequestLog.responseStatus()
belongs to the specifiedHttpStatusClass
.static ResponseLogLevelMapper
of
(HttpStatus status, LogLevel logLevel) Creates a newResponseLogLevelMapper
which returns the specifiedLogLevel
if the givenRequestLog.responseStatus()
is equal to the specifiedHttpStatus
.static ResponseLogLevelMapper
Returns the defaultResponseLogLevelMapper
which returns the specifiedsuccessfulResponseLogLevel
when logging successful responses (e.g., no unhandled exception) andfailureResponseLogLevel
if failure.static ResponseLogLevelMapper
Creates a newResponseLogLevelMapper
which returns the specifiedLogLevel
if the given class ofRequestLog.responseCause()
is assignable from the specifiedThrowable
class.default ResponseLogLevelMapper
orElse
(ResponseLogLevelMapper other) Returns a composedResponseLogLevelMapper
which represents a logical OR of thisResponseLogLevelMapper
and the givenother
.
-
Method Details
-
of
static ResponseLogLevelMapper of(LogLevel successfulResponseLogLevel, LogLevel failureResponseLogLevel) Returns the defaultResponseLogLevelMapper
which returns the specifiedsuccessfulResponseLogLevel
when logging successful responses (e.g., no unhandled exception) andfailureResponseLogLevel
if failure. -
of
Creates a newResponseLogLevelMapper
which returns the specifiedLogLevel
if the givenRequestLog.responseStatus()
is equal to the specifiedHttpStatus
. -
of
Creates a newResponseLogLevelMapper
which returns the specifiedLogLevel
if the givenRequestLog.responseStatus()
belongs to the specifiedHttpStatusClass
. -
of
Creates a newResponseLogLevelMapper
which returns the specifiedLogLevel
if the given class ofRequestLog.responseCause()
is assignable from the specifiedThrowable
class. -
apply
Returns aLogLevel
for the givenRequestLog
. Returningnull
lets the next handler specified withorElse(ResponseLogLevelMapper)
map theRequestLog
.- Specified by:
apply
in interfaceFunction<RequestLog,
LogLevel>
-
orElse
Returns a composedResponseLogLevelMapper
which represents a logical OR of thisResponseLogLevelMapper
and the givenother
. If thisapply(RequestLog)
returnsnull
, then the otherResponseLogLevelMapper
will be applied. -
compose
@Deprecated default <V> Function<V,LogLevel> compose(Function<? super V, ? extends RequestLog> before) Deprecated.Do not use this method.Returns a composed function that first applies the before function to its input, and then applies this function to the result. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.- Specified by:
compose
in interfaceFunction<RequestLog,
LogLevel>
-
andThen
@Deprecated default <V> Function<RequestLog,V> andThen(Function<? super LogLevel, ? extends V> after) Deprecated.Do not use this method.Returns a composed function that first applies this function to its input, and then applies the after function to the result. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.- Specified by:
andThen
in interfaceFunction<RequestLog,
LogLevel>
-