Package io.muserver.openapi
Class HeaderObjectBuilder
- java.lang.Object
-
- io.muserver.openapi.HeaderObjectBuilder
-
public class HeaderObjectBuilder extends java.lang.Object
A builder forHeaderObject
objects
-
-
Constructor Summary
Constructors Constructor Description HeaderObjectBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HeaderObject
build()
static HeaderObjectBuilder
headerObject()
Creates a builder for aHeaderObject
HeaderObjectBuilder
withContent(java.util.Map<java.lang.String,MediaTypeObject> content)
HeaderObjectBuilder
withDeprecated(java.lang.Boolean deprecated)
HeaderObjectBuilder
withDescription(java.lang.String description)
HeaderObjectBuilder
withExample(java.lang.Object example)
HeaderObjectBuilder
withExamples(java.util.Map<java.lang.String,ExampleObject> examples)
HeaderObjectBuilder
withExplode(java.lang.String explode)
HeaderObjectBuilder
withRequired(boolean required)
HeaderObjectBuilder
withSchema(SchemaObject schema)
HeaderObjectBuilder
withStyle(java.lang.String style)
-
-
-
Method Detail
-
withDescription
public HeaderObjectBuilder withDescription(java.lang.String description)
- Parameters:
description
- A brief description of the header. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.- Returns:
- The current builder
-
withRequired
public HeaderObjectBuilder withRequired(boolean required)
- Parameters:
required
- Determines whether this header is mandatory. The default value isfalse
.- Returns:
- The current builder
-
withDeprecated
public HeaderObjectBuilder withDeprecated(java.lang.Boolean deprecated)
- Parameters:
deprecated
- Specifies that a header is deprecated and SHOULD be transitioned out of usage.- Returns:
- The current builder
-
withStyle
public HeaderObjectBuilder withStyle(java.lang.String style)
- Parameters:
style
-Describes how the parameter value will be serialized depending on the type of the parameter value. Default value is
simple
.In order to support common ways of serializing simple parameters, a set of
style
values are defined.Style values style
type
Comments simple array
Simple style parameters defined by RFC6570. This option replaces collectionFormat
with acsv
value from OpenAPI 2.0.- Returns:
- The current builder
-
withExplode
public HeaderObjectBuilder withExplode(java.lang.String explode)
- Parameters:
explode
- When this is true, parameter values of typearray
orobject
generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. Whenstyle
isform
, the default value istrue
. For all other styles, the default value isfalse
.- Returns:
- The current builder
-
withSchema
public HeaderObjectBuilder withSchema(SchemaObject schema)
- Parameters:
schema
- The schema defining the type used for the header.- Returns:
- The current builder
-
withExample
public HeaderObjectBuilder withExample(java.lang.Object example)
- Parameters:
example
- Example of the media type. The example SHOULD match the specified schema and encoding properties if present. Theexample
field is mutually exclusive of theexamples
field. Furthermore, if referencing aschema
which contains an example, theexample
value SHALL override the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.- Returns:
- The current builder
-
withExamples
public HeaderObjectBuilder withExamples(java.util.Map<java.lang.String,ExampleObject> examples)
- Parameters:
examples
- Examples of the media type. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. Theexamples
field is mutually exclusive of theexample
field. Furthermore, if referencing aschema
which contains an example, theexamples
value SHALL override the example provided by the schema.- Returns:
- The current builder
-
withContent
public HeaderObjectBuilder withContent(java.util.Map<java.lang.String,MediaTypeObject> content)
- Parameters:
content
- A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.- Returns:
- The current builder
-
build
public HeaderObject build()
- Returns:
- A new object
-
headerObject
public static HeaderObjectBuilder headerObject()
Creates a builder for aHeaderObject
- Returns:
- A new builder
-
-