Module org.eclipse.microprofile.openapi
Package org.eclipse.microprofile.openapi.models.servers

# Interface ServerVariable

All Superinterfaces:
  `Constructible`, `Extensible<ServerVariable>`

public interface ServerVariable extends Constructible, Extensible<ServerVariable>
An object representing a Server Variable for server URL template substitution.

See Also:
  - OpenAPI Specification Server Variable Object

## Method Summary

Modifier and Type
Method
Description
`ServerVariable`
`addEnumeration(String enumeration)`
This method adds a string item to enumeration list of a ServerVariable instance and returns the instance.
`default ServerVariable`
`defaultValue(String defaultValue)`
The default value to use for substitution, and to send, if an alternate value is not supplied.
`default ServerVariable`
`description(String description)`
This method sets the description property of ServerVariable instance to the given description argument and returns the modeified instance.
`default ServerVariable`
`enumeration(List<String> enumeration)`
This method sets the enumeration property of ServerVariable instance to the given enumeration argument and returns the modified instance.
`String`
`getDefaultValue()`
The default value to use for substitution, and to send, if an alternate value is not supplied.
`String`
`getDescription()`
This method returns the description property of ServerVariable instance.
`List<String>`
`getEnumeration()`
This method returns the enumeration property of ServerVariable instance.
`void`
`removeEnumeration(String enumeration)`
This method removes a string item to enumeration list of a ServerVariable instance.
`void`
`setDefaultValue(String defaultValue)`
The default value to use for substitution, and to send, if an alternate value is not supplied.
`void`
`setDescription(String description)`
This method sets the description property of ServerVariable instance to the given description argument.
`void`
`setEnumeration(List<String> enumeration)`
This method sets the enumeration property of ServerVariable instance to the given enumeration argument.

### Methods inherited from interface org.eclipse.microprofile.openapi.models.Extensible

`addExtension, extensions, getExtensions, removeExtension, setExtensions`

## Method Details

### getEnumeration

List<String> getEnumeration()
This method returns the enumeration property of ServerVariable instance.

This property represents an enumeration of string values to be used if the substitution options are from a limited set

Returns:
  a copy List (potentially immutable) of possible values for this variable

### setEnumeration

void setEnumeration(List<String> enumeration)
This method sets the enumeration property of ServerVariable instance to the given enumeration argument.

This property represents an enumeration of string values to be used if the substitution options are from a limited set

Parameters:
  `enumeration` - an list of string values to be used if the substitution options are from a limited set

### enumeration

default ServerVariable enumeration(List<String> enumeration)
This method sets the enumeration property of ServerVariable instance to the given enumeration argument and returns the modified instance.

This property represents an enum of string values to be used if the substitution options are from a limited set.

Parameters:
  `enumeration` - an list of string values to be used if the substitution options are from a limited set
Returns:
  ServerVariable instance with the set enumeration property

### addEnumeration

ServerVariable addEnumeration(String enumeration)
This method adds a string item to enumeration list of a ServerVariable instance and returns the instance.

If the enumeration list is null, this method should create a new ArrayList and add the item.

Parameters:
  `enumeration` - an item to be added to enum list
Returns:
  ServerVariable instance with the added enum item.

### removeEnumeration

void removeEnumeration(String enumeration)
This method removes a string item to enumeration list of a ServerVariable instance.

Parameters:
  `enumeration` - an item to be removed to enum list

### getDefaultValue

String getDefaultValue()
The default value to use for substitution, and to send, if an alternate value is not supplied. This value MUST be provided by the consumer and is REQUIRED.

This method returns the defaultValue property from ServerVariable instance.

Returns:
  String defaultValue

### setDefaultValue

void setDefaultValue(String defaultValue)
The default value to use for substitution, and to send, if an alternate value is not supplied. This value MUST be provided by the consumer and is REQUIRED.

If `enumeration` is set the default value MUST be one of the values in `enumeration`.

This method sets the defaultValue property of ServerVariable instance to the given defaultValue argument.

Parameters:
  `defaultValue` - the value to use for substitution, and to send, if an alternate value is not supplied

### defaultValue

default ServerVariable defaultValue(String defaultValue)
The default value to use for substitution, and to send, if an alternate value is not supplied. This value MUST be provided by the consumer and is REQUIRED.

If `enumeration` is set the default value MUST be one of the values in `enumeration`.

This method sets the defaultValue property of ServerVariable instance to the given defaultValue argument and returns the modified instance.

Parameters:
  `defaultValue` - the value to use for substitution, and to send, if an alternate value is not supplied
Returns:
  ServerVariable instance with the set defaultValue property

### getDescription

String getDescription()
This method returns the description property of ServerVariable instance. Description property is optional for server variable.

Returns:
  String description

### setDescription

void setDescription(String description)
This method sets the description property of ServerVariable instance to the given description argument.

Description property is optional for server variable. CommonMark syntax can be used for rich text representation.

Parameters:
  `description` - a short description of the server variable

### description

default ServerVariable description(String description)
This method sets the description property of ServerVariable instance to the given description argument and returns the modeified instance.

Description property is optional for server variable. CommonMark syntax can be used for rich text representation.

Parameters:
  `description` - a short description of the server variable
Returns:
  ServerVariable instance with the set description property