Package io.servicetalk.http.api
Class HttpSerializationProviders
java.lang.Object
io.servicetalk.http.api.HttpSerializationProviders
Deprecated.
A factory to create
HttpSerializationProviders.-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpDeserializer<Map<String,List<String>>> Deprecated.static HttpDeserializer<Map<String,List<String>>> formUrlEncodedDeserializer(Charset charset) Deprecated.static HttpDeserializer<Map<String,List<String>>> formUrlEncodedDeserializer(Charset charset, Predicate<HttpHeaders> checkContentType) Deprecated.static HttpSerializer<Map<String,List<String>>> Deprecated.static HttpSerializer<Map<String,List<String>>> formUrlEncodedSerializer(Charset charset) Deprecated.static HttpSerializer<Map<String,List<String>>> formUrlEncodedSerializer(Charset charset, Consumer<HttpHeaders> addContentType) Deprecated.static HttpSerializationProviderjsonSerializer(SerializationProvider serializationProvider) static HttpSerializationProviderjsonSerializer(Serializer serializer) static HttpSerializationProviderserializationProvider(SerializationProvider serializationProvider, Consumer<HttpHeaders> addContentType, Predicate<HttpHeaders> checkContentType) Deprecated.static HttpSerializationProviderserializationProvider(Serializer serializer, Consumer<HttpHeaders> addContentType, Predicate<HttpHeaders> checkContentType) Deprecated.static HttpDeserializer<String>Deprecated.UseHttpSerializers.textSerializerUtf8()for aggregated.static HttpDeserializer<String>textDeserializer(Charset charset) Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated.static HttpDeserializer<String>textDeserializer(Charset charset, Predicate<HttpHeaders> checkContentType) Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated.static HttpSerializer<String>Deprecated.UseHttpSerializers.textSerializerUtf8()for aggregated.static HttpSerializer<String>textSerializer(Charset charset) Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated.static HttpSerializer<String>textSerializer(Charset charset, Consumer<HttpHeaders> addContentType) Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated.
-
Method Details
-
formUrlEncodedSerializer
Deprecated.Creates anHttpSerializerthat can serialize a key-valuesMaps withStandardCharsets.UTF_8Charsetto urlencoded forms.- Returns:
HttpSerializerthat could serialize key-valueMap.- See Also:
-
formUrlEncodedSerializer
@Deprecated public static HttpSerializer<Map<String,List<String>>> formUrlEncodedSerializer(Charset charset) Deprecated.Creates anHttpSerializerthat can serialize key-valuesMaps with the specifiedCharsetto to urlencoded forms.- Parameters:
charset-Charsetfor the key-valueMapthat will be serialized.- Returns:
HttpSerializerthat could serialize from key-valueMap.- See Also:
-
formUrlEncodedSerializer
@Deprecated public static HttpSerializer<Map<String,List<String>>> formUrlEncodedSerializer(Charset charset, Consumer<HttpHeaders> addContentType) Deprecated.Creates anHttpSerializerthat can serialize a key-valuesMaps with the specifiedCharsetto urlencoded forms.- Parameters:
charset-Charsetfor the key-valueMapthat will be serialized.addContentType- AConsumerthat adds relevant headers to the passedHttpHeadersmatching the serialized payload. Typically, this involves adding aHttpHeaderNames.CONTENT_TYPEheader.- Returns:
HttpSerializerthat could serialize from key-valueMap.- See Also:
-
formUrlEncodedDeserializer
Deprecated.Creates anHttpDeserializerthat can deserialize key-valuesMaps withStandardCharsets.UTF_8from urlencoded forms.- Returns:
HttpDeserializerthat could deserialize a key-valuesMap.- See Also:
-
formUrlEncodedDeserializer
@Deprecated public static HttpDeserializer<Map<String,List<String>>> formUrlEncodedDeserializer(Charset charset) Deprecated.Creates anHttpDeserializerthat can deserialize key-valuesMaps withStandardCharsets.UTF_8from urlencoded forms.- Parameters:
charset-Charsetfor the key-valueMapthat will be deserialized. deserialized payload. If the validation fails, then deserialization will fail withSerializationException- Returns:
HttpDeserializerthat could deserialize a key-valueMap.- See Also:
-
formUrlEncodedDeserializer
@Deprecated public static HttpDeserializer<Map<String,List<String>>> formUrlEncodedDeserializer(Charset charset, Predicate<HttpHeaders> checkContentType) Deprecated.Creates anHttpDeserializerthat can deserialize key-valuesMaps withStandardCharsets.UTF_8from urlencoded forms.- Parameters:
charset-Charsetfor the key-valueMapthat will be deserialized.checkContentType- Checks theHttpHeadersto see if a compatible encoding is found. deserialized payload. If the validation fails, then deserialization will fail withSerializationException- Returns:
HttpDeserializerthat could deserialize a key-valueMap.- See Also:
-
textSerializer
Deprecated.UseHttpSerializers.textSerializerUtf8()for aggregated. For streaming, use one of the following:- Returns:
HttpSerializerthat could serializeString.
-
textSerializer
Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated. For streaming, use one of the following:- Parameters:
charset-Charsetfor theStringthat will be serialized.- Returns:
HttpSerializerthat could serialize fromString.
-
textSerializer
@Deprecated public static HttpSerializer<String> textSerializer(Charset charset, Consumer<HttpHeaders> addContentType) Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated. For streaming, use one of the following:- Parameters:
charset-Charsetfor theStringthat will be serialized.addContentType- AConsumerthat adds relevant headers to the passedHttpHeadersmatching the serialized payload. Typically, this involves adding aHttpHeaderNames.CONTENT_TYPEheader.- Returns:
HttpSerializerthat could serialize fromString.
-
textDeserializer
Deprecated.UseHttpSerializers.textSerializerUtf8()for aggregated. For streaming, use one of the following:HttpSerializers.appSerializerUtf8FixLen()HttpSerializers.appSerializerAsciiVarLen()- Aggregate the payload (e.g.
StreamingHttpRequest.toRequest()) and useHttpSerializers.textSerializer(Charset)if your payload is text HttpSerializers.streamingSerializer(StreamingSerializerDeserializer, Consumer, Predicate)targeted at yourHttpHeaderNames.CONTENT_TYPE
- Returns:
HttpDeserializerthat could deserializeString.
-
textDeserializer
Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated. For streaming, use one of the following:HttpSerializers.appSerializerUtf8FixLen()HttpSerializers.appSerializerAsciiVarLen()- Aggregate the payload (e.g.
StreamingHttpRequest.toRequest()) and useHttpSerializers.textSerializer(Charset)if your payload is text HttpSerializers.streamingSerializer(StreamingSerializerDeserializer, Consumer, Predicate)targeted at yourHttpHeaderNames.CONTENT_TYPE
- Parameters:
charset-Charsetfor theStringthat will be deserialized.- Returns:
HttpDeserializerthat could deserializeString.
-
textDeserializer
@Deprecated public static HttpDeserializer<String> textDeserializer(Charset charset, Predicate<HttpHeaders> checkContentType) Deprecated.UseHttpSerializers.textSerializer(Charset)for aggregated. For streaming, use one of the following:HttpSerializers.appSerializerUtf8FixLen()HttpSerializers.appSerializerAsciiVarLen()- Aggregate the payload (e.g.
StreamingHttpRequest.toRequest()) and useHttpSerializers.textSerializer(Charset)if your payload is text HttpSerializers.streamingSerializer(StreamingSerializerDeserializer, Consumer, Predicate)targeted at yourHttpHeaderNames.CONTENT_TYPE
- Parameters:
charset-Charsetfor theStringthat will be deserialized.checkContentType- APredicatethat validates the passedHttpHeadersas expected for the deserialized payload. If the validation fails, then deserialization will fail withSerializationException- Returns:
HttpDeserializerthat could deserializeString.
-
jsonSerializer
Deprecated.Creates a newHttpSerializationProviderthat could serialize/deserialize to/from JSON using the passedSerializer. For serialization, the returnedHttpSerializationProvideradds aHttpHeaderNames.CONTENT_TYPEheader with valueHttpHeaderValues.APPLICATION_JSON. For deserialization, it expects aHttpHeaderNames.CONTENT_TYPEheader with valueHttpHeaderValues.APPLICATION_JSON. If the expected header is not present, then deserialization will fail withSerializationException.- Parameters:
serializer-Serializerthat has the capability of serializing/deserializing to/from JSON.- Returns:
HttpSerializationProviderthat has the capability of serializing/deserializing to/from JSON.
-
jsonSerializer
@Deprecated public static HttpSerializationProvider jsonSerializer(SerializationProvider serializationProvider) Deprecated.Creates a newHttpSerializationProviderthat could serialize/deserialize to/from JSON using the passedSerializationProvider. For serialization, the returnedHttpSerializationProvideradds aHttpHeaderNames.CONTENT_TYPEheader with valueHttpHeaderValues.APPLICATION_JSON. For deserialization, it expects aHttpHeaderNames.CONTENT_TYPEheader with valueHttpHeaderValues.APPLICATION_JSON. If the expected header is not present, then deserialization will fail withSerializationException.- Parameters:
serializationProvider-SerializationProviderthat has the capability of serializing/deserializing to/from JSON.- Returns:
HttpSerializationProviderthat has the capability of serializing/deserializing to/from JSON.
-
serializationProvider
@Deprecated public static HttpSerializationProvider serializationProvider(Serializer serializer, Consumer<HttpHeaders> addContentType, Predicate<HttpHeaders> checkContentType) Deprecated.Creates a newHttpSerializationProviderthat could serialize/deserialize to/from the desired content-type using the passedSerializer.For serialization, the returned
HttpSerializationProviderwould updateHttpHeadersappropriately to indicate the content-type using the passedaddContentType.For deserialization, it would validate headers as specified by the passed
checkContentType predicate. If the validation fails, then deserialization will fail withSerializationException.- Parameters:
serializer-Serializerthat has the capability of serializing/deserializing to/from a desired content-type.addContentType- AConsumerthat adds relevant headers to the passedHttpHeadersmatching the serialized payload. Typically, this involves adding aHttpHeaderNames.CONTENT_TYPEheader.checkContentType- APredicatethat validates the passedHttpHeadersas expected for the deserialized payload. If the validation fails, then deserialization will fail withSerializationException- Returns:
HttpSerializationProviderthat has the capability of serializing/deserializing to/from a desired content-type.
-
serializationProvider
@Deprecated public static HttpSerializationProvider serializationProvider(SerializationProvider serializationProvider, Consumer<HttpHeaders> addContentType, Predicate<HttpHeaders> checkContentType) Deprecated.Creates a newHttpSerializationProviderthat could serialize/deserialize to/from the desired content-type using the passedSerializationProvider.For serialization, the returned
HttpSerializationProviderwould updateHttpHeadersappropriately to indicate the content-type using the passedaddContentType.For deserialization, it would validate headers as specified by the passed
checkContentType predicate. If the validation fails, then deserialization will fail withSerializationException.- Parameters:
serializationProvider-SerializationProviderthat has the capability of serializing/deserializing to/from a desired content-type.addContentType- AConsumerthat adds relevant headers to the passedHttpHeadersmatching the serialized payload. Typically, this involves adding aHttpHeaderNames.CONTENT_TYPEheader.checkContentType- APredicatethat validates the passedHttpHeadersas expected for the deserialized payload. If the validation fails, then deserialization will fail withSerializationException.- Returns:
HttpSerializationProviderthat has the capability of serializing/deserializing to/from a desired content-type.
-
HttpSerializers.