public interface ISerializationFormat<T>
Modifier and Type | Method and Description |
---|---|
static ISerializationFormat<java.lang.String> |
asPlainText()
Constructs a serializer that just passes the given data without any
serialization as plain text.
|
java.util.Optional<EMimeType> |
getMimeType()
Returns the MIME type that should be sent to the server as "Content-Type"
header.
|
java.lang.String |
serialize(T data)
Returns the serialized data.
|
default org.apache.http.HttpEntity |
toHttpEntity(T data)
Serializes the given data and wraps it into an HttpEntity.
|
static <T> ISerializationFormat<T> |
toJson()
Constructs a generic JSON serializer.
|
static ISerializationFormat<org.apache.http.HttpEntity> |
toMultiPart()
Constructs a serializer, which expects a raw HttpEntity that should be sent
as multipart form data.
|
static ISerializationFormat<java.util.List<org.apache.http.NameValuePair>> |
toUrlEncodedFormData()
Constructs a serializer, which expects a List
|
static <T> ISerializationFormat<T> |
toXml()
Constructs a generic XML serializer.
|
java.util.Optional<EMimeType> getMimeType()
default org.apache.http.HttpEntity toHttpEntity(T data)
static <T> ISerializationFormat<T> toXml()
static <T> ISerializationFormat<T> toJson()
static ISerializationFormat<java.lang.String> asPlainText()
static ISerializationFormat<java.util.List<org.apache.http.NameValuePair>> toUrlEncodedFormData()
static ISerializationFormat<org.apache.http.HttpEntity> toMultiPart()