Package org.apache.juneau.http.part
Class SerializedPart
java.lang.Object
org.apache.juneau.http.part.BasicPart
org.apache.juneau.http.part.SerializedPart
- All Implemented Interfaces:
- NameValuePair,- Headerable
Subclass of 
NameValuePair for serializing POJOs as URL-encoded form post entries using the
 class.
 Example:
   NameValuePairs 
See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionSerializedPart(String name, Object value, HttpPartType type, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Constructor.protectedSerializedPart(SerializedPart copyFrom) Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionasHeader()Convert the object to aHeader.copy()Creates a copy of this object.copyWith(HttpPartSerializerSession serializer, HttpPartSchema schema) Copies this bean and sets the serializer and schema on it.getValue()static SerializedPartInstantiates a new instance of this object.static SerializedPartInstantiates a new instance of this object.schema(HttpPartSchema value) Sets the schema object that defines the format of the output.serializer(HttpPartSerializer value) Sets the serializer to use for serializing the value to a string value.Sets the serializer to use for serializing the value to a string value.Don't serialize this pair if the value isnull or an empty string.skipIfEmpty(boolean value) Don't serialize this pair if the value isnull or an empty string.type(HttpPartType value) Sets the HTTP part type.Methods inherited from class org.apache.juneau.http.part.BasicPartassertName, assertValue, canCast, cast, getName, getRawValue, ofPair, toString
- 
Constructor Details- 
SerializedPartpublic SerializedPart(String name, Object value, HttpPartType type, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Constructor.- Parameters:
- name- The part name.
- value- The POJO to serialize to The part 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.
 If- null , defaults to the schema defined on the serializer.
 If that's also- null , defaults to- HttpPartSchema.DEFAULT.
 Only used if serializer is schema-aware (e.g.- OpenApiSerializer).
- skipIfEmpty- If value is a blank string, the value should return as- null .
 
- 
SerializedPartCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
ofInstantiates a new instance of this object.- Parameters:
- name- The part name.
- value- The part value.
 Can be any POJO.
- Returns:
- A new SerializedPartobject, nevernull .
 
- 
ofInstantiates a new instance of this object.- Parameters:
- name- The part name.
- value- The part value supplier.
 Can be a supplier of any POJO.
- Returns:
- A new SerializedPartobject, nevernull .
 
- 
copyCreates a copy of this object.- Returns:
- A new copy of this object.
 
- 
typeSets the HTTP part type.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
serializerSets the serializer to use for serializing the value to a string value.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
serializerSets the serializer to use for serializing the value to a string value.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
schemaSets the schema object that defines the format of the output.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
copyWithCopies this bean and sets the serializer and schema on it.- Parameters:
- serializer- The new serializer for the bean. Can be- null .
- schema- The new schema for the bean. Can be- null .
- Returns:
- Either a new bean with the serializer set, or this bean if
   both values are null or the serializer and schema were already set.
 
- 
skipIfEmptyDon't serialize this pair if the value isnull or an empty string.- Returns:
- This object.
 
- 
skipIfEmptyDon't serialize this pair if the value isnull or an empty string.- Parameters:
- value- The new value of this setting.
- Returns:
- This object.
 
- 
asHeaderDescription copied from interface:HeaderableConvert the object to aHeader.- Specified by:
- asHeaderin interface- Headerable
- Overrides:
- asHeaderin class- BasicPart
- Returns:
- The object converted to a Header.
 
- 
getValue- Specified by:
- getValuein interface- NameValuePair
- Overrides:
- getValuein class- BasicPart
 
 
-