Interface BodySerDe
public interface BodySerDe
Request and response Deserialization and Serialization functionality used by generated code.
-
Method Summary
Modifier and TypeMethodDescription<T> Deserializer<T> deserializer(ExceptionDeserializerArgs<T> exceptionDeserializerArgs) <T> Deserializer<T> deserializer(TypeMarker<T> type) Creates aDeserializerfor the requested type.Returns aDeserializerthat fails if a non-empty reponse body is presented and returns null otherwise.emptyBodyDeserializer(ExceptionDeserializerArgs<Void> exceptionDeserializerArgs) Similar toemptyBodyDeserializer()but allows for specifying error type to exception mapping.default Optional<com.palantir.conjure.java.api.errors.ConjureErrorParameterFormat> Specifies the expected error parameter format for deserialization.inputStreamDeserializer(ExceptionDeserializerArgs<InputStream> exceptionDeserializerArgs) Creates aDeserializerfor input streams and with error types specified in theExceptionDeserializerArgs.Same asinputStreamDeserializer()with support for 204 responses.optionalInputStreamDeserializer(ExceptionDeserializerArgs<Optional<InputStream>> exceptionDeserializerArgs) Same asinputStreamDeserializer(ExceptionDeserializerArgs)with support for 204 responses.serialize(BinaryRequestBody value) Serializes aBinaryRequestBodyto<T> Serializer<T> serializer(TypeMarker<T> type) Creates aSerializerfor the requested type.
-
Method Details
-
serializer
Creates aSerializerfor the requested type. Serializer instances should be reused. -
deserializer
Creates aDeserializerfor the requested type. Deserializer instances should be reused. -
deserializer
Creates aDeserializerfor the base typeTspecified in theExceptionDeserializerArgs.Deserializer instances should be reused.
-
emptyBodyDeserializer
Deserializer<Void> emptyBodyDeserializer()Returns aDeserializerthat fails if a non-empty reponse body is presented and returns null otherwise. -
emptyBodyDeserializer
Similar toemptyBodyDeserializer()but allows for specifying error type to exception mapping. -
inputStreamDeserializer
Deserializer<InputStream> inputStreamDeserializer()Returns aDeserializerthat reads anInputStreamfrom theResponsebody.This method is named
inputStreamDeserializer
notbinaryDeserializer
to support future streaming binary bindings without conflicting method signatures. -
inputStreamDeserializer
Deserializer<InputStream> inputStreamDeserializer(ExceptionDeserializerArgs<InputStream> exceptionDeserializerArgs) Creates aDeserializerfor input streams and with error types specified in theExceptionDeserializerArgs. -
optionalInputStreamDeserializer
Deserializer<Optional<InputStream>> optionalInputStreamDeserializer()Same asinputStreamDeserializer()with support for 204 responses. -
optionalInputStreamDeserializer
Deserializer<Optional<InputStream>> optionalInputStreamDeserializer(ExceptionDeserializerArgs<Optional<InputStream>> exceptionDeserializerArgs) Same asinputStreamDeserializer(ExceptionDeserializerArgs)with support for 204 responses. -
serialize
Serializes aBinaryRequestBodytoapplication/octet-stream
. -
errorParameterFormat
default Optional<com.palantir.conjure.java.api.errors.ConjureErrorParameterFormat> errorParameterFormat()Specifies the expected error parameter format for deserialization. This field is used in code generation, where client interfaces can specify a header sent to servers requesting an error be serialized in the selected format. Clients should not assume that servers will always respect this header, and should be able to handle errors that are serialized in any format the server provides.
-