public class HandlerResult extends Object
Constructor and Description |
---|
HandlerResult(Object handler,
Object returnValue,
MethodParameter returnType)
Create a new
HandlerResult . |
HandlerResult(Object handler,
Object returnValue,
MethodParameter returnType,
ModelMap model)
Create a new
HandlerResult . |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<HandlerResult> |
applyExceptionHandler(Throwable failure)
Apply the exception handler and return the alternative result.
|
Object |
getHandler()
Return the handler that handled the request.
|
ModelMap |
getModel()
Return the model used during request handling with attributes that may be
used to render HTML templates with.
|
ResolvableType |
getReturnType()
Return the type of the value returned from the handler.
|
MethodParameter |
getReturnTypeSource()
Return the
MethodParameter from which
returnType was created. |
Optional<Object> |
getReturnValue()
Return the value returned from the handler wrapped as
Optional . |
boolean |
hasExceptionHandler()
Whether there is an exception handler.
|
HandlerResult |
setExceptionHandler(Function<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(Object handler, 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(Object handler, Object returnValue, MethodParameter returnType, ModelMap model)
HandlerResult
.handler
- the handler that handled the requestreturnValue
- the return value from the handler possibly null
returnType
- the return value typemodel
- the model used for request handlingpublic Object getHandler()
public Optional<Object> getReturnValue()
Optional
.public ResolvableType getReturnType()
public MethodParameter getReturnTypeSource()
MethodParameter
from which
returnType
was created.public ModelMap getModel()
public HandlerResult setExceptionHandler(Function<Throwable,reactor.core.publisher.Mono<HandlerResult>> function)
function
- the error handlerpublic boolean hasExceptionHandler()
public reactor.core.publisher.Mono<HandlerResult> applyExceptionHandler(Throwable failure)
failure
- the exception