Interface Encoding
public interface Encoding
An encoding provides support for a
Content-Typecorresponding with the conjure wire format. Encodings provide a
content type string as well as factories for typed Encoding.Serializer
and Encoding.Deserializer objects.
This interface is considered internal API and may change without a major version rev. Custom implementations are not recommended, but may be implemented to test custom encodings without a fork of the runtime.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescription<T> Encoding.Deserializer<T> deserializer(com.palantir.dialogue.TypeMarker<T> type) Creates a newEncoding.Deserializerfor the requested type.Returns the value used in request<T> Encoding.Serializer<T> serializer(com.palantir.dialogue.TypeMarker<T> type) Creates a newEncoding.Serializerfor the requested type.booleansupportsContentType(String contentType) Checks if a
-
Method Details
-
serializer
Creates a newEncoding.Serializerfor the requested type. It is recommended to reuse instances over requesting new ones for each request. -
deserializer
Creates a newEncoding.Deserializerfor the requested type. It is recommended to reuse instances over requesting new ones for each request. -
getContentType
String getContentType()Returns the value used in requestContent-Type
headers. -
supportsContentType
Checks if aContent-Type
orAccept
value is supported by this encoding. This is not an exact match ongetContentType()because values may contain additional metadata, for exampleContent-Type: application/json; charset=utf-8
may be supported by anEncodingwhich returnsapplication/json
fromgetContentType().
-