public class SerializedHeader extends BasicHeader
NameValuePair
for serializing POJOs as URL-encoded form post entries using the
class
.
NameValuePairs params =
Constructor and Description |
---|
SerializedHeader(String name,
Object value,
HttpPartSerializerSession serializer,
HttpPartSchema schema,
boolean skipIfEmpty)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getValue() |
static SerializedHeader |
of(String name,
Object value)
Instantiates a new instance of this object.
|
static SerializedHeader |
of(String name,
Supplier<?> value)
Instantiates a new instance of this object.
|
SerializedHeader |
schema(HttpPartSchema value)
Sets the schema object that defines the format of the output.
|
SerializedHeader |
serializer(HttpPartSerializer value)
Sets the serializer to use for serializing the value to a string value.
|
SerializedHeader |
serializer(HttpPartSerializerSession value)
Sets the serializer to use for serializing the value to a string value.
|
SerializedHeader |
serializer(HttpPartSerializerSession value,
boolean overwrite)
Sets the serializer to use for serializing the value to a string value.
|
SerializedHeader |
skipIfEmpty()
Don't serialize this header if the value is
|
SerializedHeader |
skipIfEmpty(boolean value)
Don't serialize this header if the value is
|
assertName, assertValue, canCast, cast, eqIC, equals, getElements, getName, getRawValue, hashCode, isSupplier, of, ofPair, toString, unwrap
public SerializedHeader(String name, Object value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty)
name
- The HTTP header name name.value
- The POJO to serialize to the parameter value.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
).
Supplier
.skipIfEmpty
- If value is a blank string, the value should return as public static SerializedHeader of(String name, Object value)
public static SerializedHeader of(String name, Supplier<?> value)
public SerializedHeader serializer(HttpPartSerializer value)
value
- The new value for this property.public SerializedHeader serializer(HttpPartSerializerSession value)
value
- The new value for this property.public SerializedHeader serializer(HttpPartSerializerSession value, boolean overwrite)
value
- The new value for this property.overwrite
- If public SerializedHeader schema(HttpPartSchema value)
value
- The new value for this property.public SerializedHeader skipIfEmpty()
public SerializedHeader skipIfEmpty(boolean value)
value
- The new value of this setting.public String getValue()
getValue
in interface NameValuePair
getValue
in class BasicHeader
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.