Package io.servicetalk.http.api
Interface HttpSerializer2<T>
- Type Parameters:
T
- The type of objects to serialize.
- All Known Subinterfaces:
HttpSerializer<T>
,HttpSerializerDeserializer<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A factory to address serialization concerns for HTTP request/response payload bodies.
-
Method Summary
Modifier and TypeMethodDescriptionserialize
(HttpHeaders headers, T value, BufferAllocator allocator) Serialize an object of typeHttpSerializer2
into aBuffer
.
-
Method Details
-
serialize
Serialize an object of typeHttpSerializer2
into aBuffer
. If necessary theHttpHeaders
should be updated to indicate the content-type.- Parameters:
headers
- TheHttpHeaders
associated with the serialization operation.value
- The object to serialize.allocator
- TheBufferAllocator
used to create the returnedBuffer
.- Returns:
- The result of the serialization operation.
-