All Superinterfaces:
Constructible, Extensible<Parameter>, Reference<Parameter>

public interface Parameter extends Constructible, Extensible<Parameter>, Reference<Parameter>
Parameter

Describes a single operation parameter.

A unique parameter is defined by a combination of a name and location. There are four possible parameter locations specified by the in field:

  • path - Used together with Path Templating, where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in /items/{itemId}, the path parameter is itemId.
  • query - Parameters that are appended to the URL. For example, in /items?id=###, the query parameter is id.
  • header - Custom headers that are expected as part of the request. Note that RFC7230 states header names are case insensitive.
  • cookie - Used to pass a specific cookie value to the API.

The rules for serialization of the parameter are specified in one of two ways. For simpler scenarios, a schema and style can describe the structure and syntax of the parameter.

For more complex scenarios, the content property can define the media type and schema of the parameter. A parameter must contain either a schema property, or a content property, but not both.

See Also:
  • Method Details

    • getName

      String getName()
      Returns the name property from a Parameter instance.
      Returns:
      the name of the parameter
    • setName

      void setName(String name)
      Sets the name property of a Parameter instance to the given string.
      Parameters:
      name - the name of the parameter
    • name

      default Parameter name(String name)
      Sets the name property of a Parameter instance to the given string.
      Parameters:
      name - the name of the parameter
      Returns:
      the current Parameter instance
    • getIn

      Parameter.In getIn()
      Returns the in property from a Parameter instance.
      Returns:
      the location of the parameter
    • setIn

      void setIn(Parameter.In in)
      Sets the in property of a Parameter instance to the given value.
      Parameters:
      in - the value of the in property
    • in

      default Parameter in(Parameter.In in)
      Sets the in property of a Parameter instance to the given value.
      Parameters:
      in - the value of the in property
      Returns:
      the current Parameter instance
    • getDescription

      String getDescription()
      Returns the description property from a Parameter instance.
      Returns:
      a brief description of the parameter
    • setDescription

      void setDescription(String description)
      Sets the description property of a Parameter instance to the given string.
      Parameters:
      description - a brief description of the parameter
    • description

      default Parameter description(String description)
      Sets the description property of a Parameter instance to the given string.
      Parameters:
      description - a brief description of the parameter
      Returns:
      the current Parameter instance
    • getRequired

      Boolean getRequired()
      Returns the required property from a Parameter instance.
      Returns:
      indicates whether this parameter is mandatory
    • setRequired

      void setRequired(Boolean required)
      Sets the required property of a Parameter instance to the given value.
      Parameters:
      required - indicates whether this parameter is mandatory
    • required

      default Parameter required(Boolean required)
      Sets the required property of a Parameter instance to the given value.
      Parameters:
      required - indicates whether this parameter is mandatory
      Returns:
      the current Parameter instance
    • getDeprecated

      Boolean getDeprecated()
      Returns the deprecated property from a Parameter instance.
      Returns:
      specifies that a parameter is deprecated
    • setDeprecated

      void setDeprecated(Boolean deprecated)
      Sets the deprecated property of a Parameter instance to the given value.
      Parameters:
      deprecated - specifies that a parameter is deprecated
    • deprecated

      default Parameter deprecated(Boolean deprecated)
      Sets the deprecated property of a Parameter instance to the given value.
      Parameters:
      deprecated - specifies that a parameter is deprecated
      Returns:
      the current Parameter instance
    • getAllowEmptyValue

      Boolean getAllowEmptyValue()
      Returns the allowEmptyValue property from a Parameter instance.
      Returns:
      specifies the ability to pass empty-valued parameters
    • setAllowEmptyValue

      void setAllowEmptyValue(Boolean allowEmptyValue)
      Sets the allowEmptyValue property of a Parameter instance to the given value.
      Parameters:
      allowEmptyValue - specify the ability to pass empty-valued parameters
    • allowEmptyValue

      default Parameter allowEmptyValue(Boolean allowEmptyValue)
      Sets the allowEmptyValue property of a Parameter instance to the given value.
      Parameters:
      allowEmptyValue - specify the ability to pass empty-valued parameters
      Returns:
      the current Parameter instance
    • getStyle

      Parameter.Style getStyle()
      Returns the style property from a Parameter instance.
      Returns:
      describes how the parameter value will be serialized
    • setStyle

      void setStyle(Parameter.Style style)
      Sets the style property of a Parameter instance to the given value.
      Parameters:
      style - describes how the parameter value will be serialized
    • style

      default Parameter style(Parameter.Style style)
      Sets the style property of a Parameter instance to the given value.
      Parameters:
      style - describes how the parameter value will be serialized
      Returns:
      the current Parameter instance
    • getExplode

      Boolean getExplode()
      Returns the explode property from a Parameter instance.
      Returns:
      whether parameter values of type "array" or "object" generate separate parameters for each value
    • setExplode

      void setExplode(Boolean explode)
      Sets the explode property of a Parameter instance to the given value.
      Parameters:
      explode - whether parameter values of type "array" or "object" generate separate parameters for each value
    • explode

      default Parameter explode(Boolean explode)
      Sets the explode property of a Parameter instance to the given value.
      Parameters:
      explode - whether parameter values of type "array" or "object" generate separate parameters for each value
      Returns:
      the current Parameter instance
    • getAllowReserved

      Boolean getAllowReserved()
      Returns the allowReserved property from a Parameter instance.
      Returns:
      specifies whether the parameter value should allow reserved characters
    • setAllowReserved

      void setAllowReserved(Boolean allowReserved)
      Sets the allowReserved property of a Parameter instance to the given value.
      Parameters:
      allowReserved - specifies whether the parameter value should allow reserved characters
    • allowReserved

      default Parameter allowReserved(Boolean allowReserved)
      Sets the allowReserved property of a Parameter instance to the given value.
      Parameters:
      allowReserved - specifies whether the parameter value should allow reserved characters
      Returns:
      the current Parameter instance
    • getSchema

      Schema getSchema()
      Returns the schema property from a Parameter instance.
      Returns:
      schema defining the type used for the parameter
    • setSchema

      void setSchema(Schema schema)
      Sets the schema property of a Parameter instance to the given value.
      Parameters:
      schema - schema defining the type used for the parameter
    • schema

      default Parameter schema(Schema schema)
      Sets the schema property of a Parameter instance to the given value.
      Parameters:
      schema - schema defining the type used for the parameter
      Returns:
      the current Parameter instance
    • getExamples

      Map<String,Example> getExamples()
      Returns the examples property from a Parameter instance.
      Returns:
      a copy Map (potentially immutable) of examples of the parameter
    • setExamples

      void setExamples(Map<String,Example> examples)
      Sets the examples property of a Parameter instance to the given value. 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 parameter
    • examples

      default Parameter examples(Map<String,Example> examples)
      Sets the examples property of a Parameter instance to the given value. 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 parameter
      Returns:
      the current Parameter instance
    • addExample

      Parameter addExample(String key, Example example)
      Adds an example of the parameter using the specified key. The example should contain a value in the correct format as specified in the parameter encoding.
      Parameters:
      key - string to represent the example
      example - example of the parameter. null values will be rejected (implementation will throw an exception) or ignored.
      Returns:
      the current Parameter instance
    • removeExample

      void removeExample(String key)
      Removes an example of the parameter using the specified key. The example should contain a value in the correct format as specified in the parameter encoding.
      Parameters:
      key - string to represent the example
    • getExample

      Object getExample()
      Returns the example property from a Parameter instance.
      Returns:
      example of the parameter
    • setExample

      void setExample(Object example)
      Sets the example property of a Parameter instance 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 parameter
    • example

      default Parameter example(Object example)
      Sets the example property of a Parameter instance 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 parameter
      Returns:
      the current Parameter instance
    • getContent

      Content getContent()
      Returns the content property from a Parameter instance.
      Returns:
      a map containing the media representations for the parameter
    • setContent

      void setContent(Content content)
      Sets the content property of a Parameter instance to the given object.
      Parameters:
      content - a map containing the media representations for the parameter
    • content

      default Parameter content(Content content)
      Sets the content property of a Parameter instance to the given object.
      Parameters:
      content - a map containing the media representations for the parameter
      Returns:
      the current Parameter instance