public class HandlerResult
extends java.lang.Object
Constructor and Description |
---|
HandlerResult(java.lang.Object handler,
java.lang.Object returnValue,
MethodParameter returnType)
Create a new
HandlerResult . |
HandlerResult(java.lang.Object handler,
java.lang.Object returnValue,
MethodParameter returnType,
BindingContext context)
Create a new
HandlerResult . |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<HandlerResult> |
applyExceptionHandler(java.lang.Throwable failure)
Apply the exception handler and return the alternative result.
|
BindingContext |
getBindingContext()
Return the BindingContext used for request handling.
|
java.lang.Object |
getHandler()
Return the handler that handled the request.
|
Model |
getModel()
Return the model used for request handling.
|
ResolvableType |
getReturnType()
Return the type of the value returned from the handler -- e.g.
|
MethodParameter |
getReturnTypeSource()
Return the
MethodParameter from which returnType was created. |
java.lang.Object |
getReturnValue()
Return the value returned from the handler, if any.
|
boolean |
hasExceptionHandler()
Whether there is an exception handler.
|
HandlerResult |
setExceptionHandler(java.util.function.Function<java.lang.Throwable,reactor.core.publisher.Mono<HandlerResult>> function)
Configure an exception handler that may be used to produce an alternative
result when result handling fails.
|
public HandlerResult(java.lang.Object handler, @Nullable java.lang.Object returnValue, MethodParameter returnType)
HandlerResult
.handler
- the handler that handled the requestreturnValue
- the return value from the handler possibly null
returnType
- the return value typepublic HandlerResult(java.lang.Object handler, @Nullable java.lang.Object returnValue, MethodParameter returnType, @Nullable BindingContext context)
HandlerResult
.handler
- the handler that handled the requestreturnValue
- the return value from the handler possibly null
returnType
- the return value typecontext
- the binding context used for request handlingpublic java.lang.Object getHandler()
@Nullable public java.lang.Object getReturnValue()
public ResolvableType getReturnType()
getReturnTypeSource()
to obtain the underlying
MethodParameter
for the return type.public MethodParameter getReturnTypeSource()
MethodParameter
from which returnType
was created.public BindingContext getBindingContext()
public Model getModel()
getBindingContext().getModel()
.public HandlerResult setExceptionHandler(java.util.function.Function<java.lang.Throwable,reactor.core.publisher.Mono<HandlerResult>> function)
function
- the error handlerpublic boolean hasExceptionHandler()
public reactor.core.publisher.Mono<HandlerResult> applyExceptionHandler(java.lang.Throwable failure)
failure
- the exception