org.springframework.messaging.handler.invocation.reactive

## Class HandlerMethodReturnValueHandlerComposite

- java.lang.Object
- - org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandlerComposite

All Implemented Interfaces:
  HandlerMethodReturnValueHandler

    public class HandlerMethodReturnValueHandlerComposite
    extends Object
    implements HandlerMethodReturnValueHandler

A HandlerMethodReturnValueHandler that wraps and delegates to others.

Since:
  5.2
Author:
  Rossen Stoyanchev

### Field Summary

Fields
`protected Log` `logger`

### Fields inherited from interface org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler

`DATA_BUFFER_FACTORY_HEADER`

### Constructor Summary

Constructors
Constructor and Description
`HandlerMethodReturnValueHandlerComposite()`

### Method Summary

All Methods Instance Methods Concrete Methods
`HandlerMethodReturnValueHandlerComposite` `addHandler(HandlerMethodReturnValueHandler returnValueHandler)` Add the given `HandlerMethodReturnValueHandler`.
`HandlerMethodReturnValueHandlerComposite` `addHandlers(List<? extends HandlerMethodReturnValueHandler> handlers)` Add the given `HandlerMethodReturnValueHandlers`.
`void` `clear()` Clear the list of configured handlers.
`List<HandlerMethodReturnValueHandler>` `getReturnValueHandlers()` Return a read-only list with the configured handlers.
`reactor.core.publisher.Mono<Void>` `handleReturnValue(Object returnValue, org.springframework.core.MethodParameter returnType, Message<?> message)` Handle the given return value.
`boolean` `supportsReturnType(org.springframework.core.MethodParameter returnType)` Whether the given method return type is supported by this handler.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### logger

    protected final Log logger

### Constructor Detail

#### HandlerMethodReturnValueHandlerComposite

    public HandlerMethodReturnValueHandlerComposite()

### Method Detail

#### getReturnValueHandlers

    public List<HandlerMethodReturnValueHandler> getReturnValueHandlers()

Return a read-only list with the configured handlers.

#### clear

    public void clear()

Clear the list of configured handlers.

#### addHandler

    public HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler returnValueHandler)

Add the given `HandlerMethodReturnValueHandler`.

#### addHandlers

    public HandlerMethodReturnValueHandlerComposite addHandlers(@Nullable
                                                                List<? extends HandlerMethodReturnValueHandler> handlers)

Add the given `HandlerMethodReturnValueHandlers`.

#### supportsReturnType

    public boolean supportsReturnType(org.springframework.core.MethodParameter returnType)

Description copied from interface: `HandlerMethodReturnValueHandler`
Whether the given method return type is supported by this handler.

Specified by:
  `supportsReturnType` in interface `HandlerMethodReturnValueHandler`
Parameters:
  `returnType` - the method return type to check
Returns:
  `true` if this handler supports the supplied return type; `false` otherwise

#### handleReturnValue

    public reactor.core.publisher.Mono<Void> handleReturnValue(@Nullable
                                                               Object returnValue,
                                                               org.springframework.core.MethodParameter returnType,
                                                               Message<?> message)

Description copied from interface: `HandlerMethodReturnValueHandler`
Handle the given return value.

Specified by:
  `handleReturnValue` in interface `HandlerMethodReturnValueHandler`
Parameters:
  `returnValue` - the value returned from the handler method
  `returnType` - the type of the return value. This type must have previously been passed to `HandlerMethodReturnValueHandler.supportsReturnType(MethodParameter)` and it must have returned `true`.
Returns:
  `Mono<Void>` to indicate when handling is complete.