public abstract class AbstractSingleValueEncoder<T> extends AbstractEncoder<T>
Encoder
classes that can only deal with a single value.Constructor and Description |
---|
AbstractSingleValueEncoder(MimeType... supportedMimeTypes) |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Flux<DataBuffer> |
encode(org.reactivestreams.Publisher<? extends T> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Encode a stream of Objects of type
T into a DataBuffer
output stream. |
protected abstract reactor.core.publisher.Flux<DataBuffer> |
encode(T t,
DataBufferFactory dataBufferFactory,
ResolvableType type,
MimeType mimeType,
Map<String,Object> hints)
Encode
T to an output DataBuffer stream. |
canEncode, getEncodableMimeTypes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContentLength
public AbstractSingleValueEncoder(MimeType... supportedMimeTypes)
public final reactor.core.publisher.Flux<DataBuffer> encode(org.reactivestreams.Publisher<? extends T> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
Encoder
T
into a DataBuffer
output stream.inputStream
- the input stream of Objects to encode. If the input should be
encoded as a single value rather than as a stream of elements, an instance of
Mono
should be used.bufferFactory
- for creating output stream DataBuffer
'selementType
- the expected type of elements in the input stream;
this type must have been previously passed to the Encoder.canEncode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
method and it must have returned true
.mimeType
- the MIME type for the output stream (optional)hints
- additional information about how to do encodeprotected abstract reactor.core.publisher.Flux<DataBuffer> encode(T t, DataBufferFactory dataBufferFactory, ResolvableType type, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
T
to an output DataBuffer
stream.t
- the value to processdataBufferFactory
- a buffer factory used to create the outputtype
- the stream element type to processmimeType
- the mime type to processhints
- Additional information about how to do decode, optional