Interface Header
-
- All Superinterfaces:
Constructible,Extensible<Header>,Reference<Header>
public interface Header extends Constructible, Extensible<Header>, Reference<Header>
HeaderDescribes a single header parameter for an operation.
- See Also:
- OpenAPI Specification Header Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classHeader.StyleControls the style of serialization.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description HeaderaddExample(String key, Example example)Adds an example of the header using the specified key to this Header instance.default HeaderallowEmptyValue(Boolean allowEmptyValue)Sets this Header's allowEmptyValue property to the given value.default Headercontent(Content content)Sets this Header's content property to the given object.default Headerdeprecated(Boolean deprecated)Sets this Header's deprecated property to the given value.default Headerdescription(String description)Sets this Header's description property to the given string.default Headerexample(Object example)Sets this Header's example property to the given object.default Headerexamples(Map<String,Example> examples)Sets the examples property of this Header instance to the given map.default Headerexplode(Boolean explode)Sets this Header's explode property to the given value.BooleangetAllowEmptyValue()Returns the allowEmptyValue property from a Header instance.ContentgetContent()Returns the content property from a Header instance.BooleangetDeprecated()Returns the deprecated property from a Header instance.StringgetDescription()Returns the description property from a Header instance.ObjectgetExample()Returns the example property from a Header instance.Map<String,Example>getExamples()Returns the examples property from a Header instance.BooleangetExplode()Returns the explode property from a Header instance.BooleangetRequired()Returns the required property from a Header instance.SchemagetSchema()Returns the schema property from a Header instance.Header.StylegetStyle()Returns the style property from a Header instance.voidremoveExample(String key)Removes an example of the header using the specified key to this Header instance.default Headerrequired(Boolean required)Sets this Header's required property to the given value.default Headerschema(Schema schema)Sets this Header's schema property to the given object.voidsetAllowEmptyValue(Boolean allowEmptyValue)Sets this Header's allowEmptyValue property to the given value.voidsetContent(Content content)Sets this Header's content property to the given object.voidsetDeprecated(Boolean deprecated)Sets this Header's deprecated property to the given value.voidsetDescription(String description)Sets this Header's description property to the given string.voidsetExample(Object example)Sets this Header's example property to the given object.voidsetExamples(Map<String,Example> examples)Sets the examples property of this Header instance to the given map.voidsetExplode(Boolean explode)Sets this Header's explode property to the given value.voidsetRequired(Boolean required)Sets this Header's required property to the given value.voidsetSchema(Schema schema)Sets this Header's schema property to the given object.voidsetStyle(Header.Style style)Sets this Header's style property to the given style.default Headerstyle(Header.Style style)Sets this Header's style property to the given style.-
Methods inherited from interface org.eclipse.microprofile.openapi.models.Extensible
addExtension, extensions, getExtensions, removeExtension, setExtensions
-
-
-
-
Method Detail
-
getDescription
String getDescription()
Returns the description property from a Header instance.- Returns:
- a brief description of the header parameter.
-
setDescription
void setDescription(String description)
Sets this Header's description property to the given string.- Parameters:
description- a brief description of the header parameter
-
description
default Header description(String description)
Sets this Header's description property to the given string.- Parameters:
description- a brief description of the header parameter- Returns:
- the current Header instance
-
getRequired
Boolean getRequired()
Returns the required property from a Header instance.- Returns:
- whether this parameter is mandatory
-
setRequired
void setRequired(Boolean required)
Sets this Header's required property to the given value.- Parameters:
required- whether this parameter is mandatory
-
required
default Header required(Boolean required)
Sets this Header's required property to the given value.- Parameters:
required- whether this parameter is mandatory- Returns:
- the current Header instance
-
getDeprecated
Boolean getDeprecated()
Returns the deprecated property from a Header instance.- Returns:
- whether the header parameter is deprecated
-
setDeprecated
void setDeprecated(Boolean deprecated)
Sets this Header's deprecated property to the given value.- Parameters:
deprecated- whether the header parameter is deprecated
-
deprecated
default Header deprecated(Boolean deprecated)
Sets this Header's deprecated property to the given value.- Parameters:
deprecated- whether the header parameter is deprecated- Returns:
- the current Header instance
-
getAllowEmptyValue
Boolean getAllowEmptyValue()
Returns the allowEmptyValue property from a Header instance.- Returns:
- the ability to pass empty-valued parameters
-
setAllowEmptyValue
void setAllowEmptyValue(Boolean allowEmptyValue)
Sets this Header's allowEmptyValue property to the given value.- Parameters:
allowEmptyValue- specify the ability to pass empty-valued parameters
-
allowEmptyValue
default Header allowEmptyValue(Boolean allowEmptyValue)
Sets this Header's allowEmptyValue property to the given value.- Parameters:
allowEmptyValue- specify the ability to pass empty-valued parameters- Returns:
- the current Header instance
-
getStyle
Header.Style getStyle()
Returns the style property from a Header instance.- Returns:
- how the parameter value will be serialized
-
setStyle
void setStyle(Header.Style style)
Sets this Header's style property to the given style.- Parameters:
style- how the parameter value will be serialized
-
style
default Header style(Header.Style style)
Sets this Header's style property to the given style.- Parameters:
style- how the parameter value will be serialized- Returns:
- the current Header instance
-
getExplode
Boolean getExplode()
Returns the explode property from a Header instance.- Returns:
- whether parameter values of type "array" or "object" generate separate parameters for each value
-
setExplode
void setExplode(Boolean explode)
Sets this Header's explode property to the given value.- Parameters:
explode- whether parameter values of type "array" or "object" generate separate parameters for each value
-
explode
default Header explode(Boolean explode)
Sets this Header's explode property to the given value.- Parameters:
explode- whether parameter values of type "array" or "object" generate separate parameters for each value- Returns:
- the current Header instance
-
getSchema
Schema getSchema()
Returns the schema property from a Header instance.- Returns:
- schema defining the type used for the header parameter
-
setSchema
void setSchema(Schema schema)
Sets this Header's schema property to the given object.- Parameters:
schema- schema defining the type used for the header parameter
-
schema
default Header schema(Schema schema)
Sets this Header's schema property to the given object.- Parameters:
schema- schema defining the type used for the header parameter- Returns:
- the current Header instance
-
getExamples
Map<String,Example> getExamples()
Returns the examples property from a Header instance.- Returns:
- a copy Map (potentially immutable) of examples of the header
-
setExamples
void setExamples(Map<String,Example> examples)
Sets the examples property of this Header instance to the given map. Each example should contain a value in the correct format as specified in the parameter encoding. The examples object is mutually exclusive of the example object.- Parameters:
examples- examples of the header
-
examples
default Header examples(Map<String,Example> examples)
Sets the examples property of this Header instance to the given map. Each example should contain a value in the correct format as specified in the parameter encoding. The examples object is mutually exclusive of the example object.- Parameters:
examples- examples of the header- Returns:
- the current Header instance
-
addExample
Header addExample(String key, Example example)
Adds an example of the header using the specified key to this Header instance. The example should contain a value in the correct format as specified in the parameter encoding.- Parameters:
key- string to represent the exampleexample- example of the header. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- the current Header instance
-
removeExample
void removeExample(String key)
Removes an example of the header using the specified key to this Header instance.- Parameters:
key- string to represent the example
-
getExample
Object getExample()
Returns the example property from a Header instance.- Returns:
- example of the header
-
setExample
void setExample(Object example)
Sets this Header's example property to the given object. The example should match the specified schema and encoding properties if present. The examples object is mutually exclusive of the example object.- Parameters:
example- example of the header
-
example
default Header example(Object example)
Sets this Header's example property to the given object. The example should match the specified schema and encoding properties if present. The examples object is mutually exclusive of the example object.- Parameters:
example- example of the header- Returns:
- the current Header instance
-
getContent
Content getContent()
Returns the content property from a Header instance.- Returns:
- a map containing the media representations for the parameter
-
setContent
void setContent(Content content)
Sets this Header's content property to the given object.- Parameters:
content- a map containing the media representations for the parameter
-
-