Class ImmediateMultiObjectBody
java.lang.Object
io.micronaut.http.server.netty.body.ImmediateMultiObjectBody
- All Implemented Interfaces:
HttpBody,MultiObjectBody
Immediate
MultiObjectBody, all operations are eager.- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPublisher<?>Get this value as a publisher.coerceToInputStream(io.netty.buffer.ByteBufAllocator alloc) Coerce this value to anInputStream.voidhandleForm(FormRouteCompleter formRouteCompleter) Special handling for form data.mapNotNull(Function<Object, Object> transform) Apply a mapping function to all objects in this body.next()Get the next representation this body was transformed into, if any.final voidrelease()Release this body and any downstream representations.toMap(Charset charset, Collection<? extends MicronautHttpData<?>> dataList)
-
Constructor Details
-
ImmediateMultiObjectBody
-
-
Method Details
-
single
public ImmediateSingleObjectBody single(Charset defaultCharset, io.netty.buffer.ByteBufAllocator alloc) -
toMap
public static Map<String,Object> toMap(Charset charset, Collection<? extends MicronautHttpData<?>> dataList) -
coerceToInputStream
Description copied from interface:MultiObjectBodyCoerce this value to anInputStream. This implementsNettyInputStreamBodyBinder. Requires the objects of this body to beByteBufs.
Ownership is transferred to the stream, it must be closed to release all buffers.- Specified by:
coerceToInputStreamin interfaceMultiObjectBody- Parameters:
alloc- The buffer allocator to use- Returns:
- The stream that reads the data in this body
-
asPublisher
Description copied from interface:MultiObjectBodyGet this value as a publisher. The publisher must be subscribed to exactly once. All objects forwarded to the subscriber become its responsibility and must be released by the subscriber.- Specified by:
asPublisherin interfaceMultiObjectBody- Returns:
- The publisher
-
mapNotNull
Description copied from interface:MultiObjectBodyApply a mapping function to all objects in this body.nullvalues in the output are skipped.- Specified by:
mapNotNullin interfaceMultiObjectBody- Parameters:
transform- The mapping function- Returns:
- A new body with the mapped values
-
handleForm
Description copied from interface:MultiObjectBodySpecial handling for form data. This method basically acts likeasPublisher().subscribe(formRouteCompleter). However,FormRouteCompleterneeds to release the form data fields when the request is destroyed. To do this, it implementsHttpBody.release(). By calling this method, theFormRouteCompleteris registered as thenext bodyand will be released.- Specified by:
handleFormin interfaceMultiObjectBody- Parameters:
formRouteCompleter- The form route completer that should take over processing
-
release
public final void release()Description copied from interface:HttpBodyRelease this body and any downstream representations. -
next
Description copied from interface:HttpBodyGet the next representation this body was transformed into, if any.
-