Package org.apache.juneau.http.header
Class SerializedHeader
java.lang.Object
org.apache.juneau.http.header.BasicHeader
org.apache.juneau.http.header.SerializedHeader
- All Implemented Interfaces:
- Serializable,- Cloneable,- Header,- NameValuePair
TODO
 
See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionSerializedHeader(String name, Object value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Constructor.SerializedHeader(String name, Supplier<Object> value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Constructor with delayed value.protectedSerializedHeader(SerializedHeader copyFrom) Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptioncopy()Creates a copy of this object.copyWith(HttpPartSerializerSession serializer, HttpPartSchema schema) Copies this bean and sets the serializer and schema on it.getValue()static SerializedHeaderStatic creator.static SerializedHeaderof(String name, Object value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Static creator.static SerializedHeaderStatic creator with delayed value.static SerializedHeaderof(String name, Supplier<?> value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Static creator with delayed value.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 header if the value isnull or an empty string.skipIfEmpty(boolean value) Don't serialize this header if the value isnull or an empty string.Methods inherited from class org.apache.juneau.http.header.BasicHeaderassertName, assertStringValue, asString, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, orElse, toString
- 
Constructor Details- 
SerializedHeaderpublic SerializedHeader(String name, Object value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Constructor.- Parameters:
- 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.
 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).
 Can also be a- Supplier.
- skipIfEmpty- If value is a blank string, the value should return as- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
SerializedHeaderpublic SerializedHeader(String name, Supplier<Object> value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Constructor with delayed value.Header value is re-evaluated on each call to getValue().- Parameters:
- name- The HTTP header name name.
- value- The supplier of 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.
 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).
 Can also be a- Supplier.
- skipIfEmpty- If value is a blank string, the value should return as- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
SerializedHeaderCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- name- The header name.
- value- The POJO to serialize as the header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
ofStatic creator with delayed value.Header value is re-evaluated on each call to getValue().- Parameters:
- name- The header name.
- value- The supplier of the POJO to serialize as the header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
ofpublic static SerializedHeader of(String name, Object value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Static creator.- Parameters:
- name- The HTTP header name name.
- value- The POJO to serialize as the header 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.
 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).
 Can also be a- Supplier.
- skipIfEmpty- If value is a blank string, the value should return as- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
ofpublic static SerializedHeader of(String name, Supplier<?> value, HttpPartSerializerSession serializer, HttpPartSchema schema, boolean skipIfEmpty) Static creator with delayed value.Header value is re-evaluated on each call to getValue().- Parameters:
- name- The HTTP header name name.
- value- The supplier of the POJO to serialize as the header 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.
 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).
 Can also be a- Supplier.
- skipIfEmpty- If value is a blank string, the value should return as- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
copyCreates a copy of this object.- Returns:
- A new copy of 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 header if the value isnull or an empty string.- Returns:
- This object.
 
- 
skipIfEmptyDon't serialize this header if the value isnull or an empty string.- Parameters:
- value- The new value of this setting.
- Returns:
- This object.
 
- 
getValue- Specified by:
- getValuein interface- NameValuePair
- Overrides:
- getValuein class- BasicHeader
 
 
-