public class SerializedNameValuePair extends BasicNameValuePair implements Headerable
NameValuePair
for serializing POJOs as URL-encoded form post entries using the
class
.
NameValuePairs params =
Constructor and Description |
---|
SerializedNameValuePair(String name,
Object value,
HttpPartType type,
HttpPartSerializerSession serializer,
HttpPartSchema schema,
boolean skipIfEmpty)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SerializedHeader |
asHeader()
Convert the object to a
Header . |
String |
getValue() |
static SerializedNameValuePair |
of(String name,
Object value)
Instantiates a new instance of this object.
|
static SerializedNameValuePair |
of(String name,
Supplier<?> value)
Instantiates a new instance of this object.
|
SerializedNameValuePair |
schema(HttpPartSchema value)
Sets the schema object that defines the format of the output.
|
SerializedNameValuePair |
serializer(HttpPartSerializer value)
Sets the serializer to use for serializing the value to a string value.
|
SerializedNameValuePair |
serializer(HttpPartSerializerSession value)
Sets the serializer to use for serializing the value to a string value.
|
SerializedNameValuePair |
serializer(HttpPartSerializerSession value,
boolean overwrite)
Sets the serializer to use for serializing the value to a string value.
|
SerializedNameValuePair |
skipIfEmpty()
Don't serialize this pair if the value is
|
SerializedNameValuePair |
skipIfEmpty(boolean value)
Don't serialize this pair if the value is
|
String |
toString() |
SerializedNameValuePair |
type(HttpPartType value)
Sets the HTTP part type.
|
assertName, assertValue, canCast, cast, getName, ofPair
public SerializedNameValuePair(String name, Object value, HttpPartType type, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty)
name
- The parameter name.value
- The POJO to serialize to the parameter value.type
- The HTTP part type.serializer
- The serializer to use for serializing the value to a string value.schema
- The schema object that defines the format of the output.
HttpPartSchema.DEFAULT
.
OpenApiSerializer
).skipIfEmpty
- If value is a blank string, the value should return as public static SerializedNameValuePair of(String name, Object value)
public static SerializedNameValuePair of(String name, Supplier<?> value)
public SerializedNameValuePair type(HttpPartType value)
value
- The new value for this property.public SerializedNameValuePair serializer(HttpPartSerializer value)
value
- The new value for this property.public SerializedNameValuePair serializer(HttpPartSerializerSession value)
value
- The new value for this property.public SerializedNameValuePair serializer(HttpPartSerializerSession value, boolean overwrite)
value
- The new value for this property.overwrite
- If public SerializedNameValuePair schema(HttpPartSchema value)
value
- The new value for this property.public SerializedNameValuePair skipIfEmpty()
public SerializedNameValuePair skipIfEmpty(boolean value)
value
- The new value of this setting.public SerializedHeader asHeader()
Headerable
Header
.asHeader
in interface Headerable
asHeader
in class BasicNameValuePair
Header
.public String getValue()
getValue
in interface NameValuePair
getValue
in class BasicNameValuePair
public String toString()
toString
in class BasicNameValuePair
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.