Top Description Methods
org.eclipse.microprofile.openapi.models.servers

public Interface Server

extends Constructible, Extensible<Server>
Imports
java.util.Map, org.eclipse.microprofile.openapi.models.Constructible, .Extensible

An object representing a server.
See Also
OpenAPI Specification Server Object

Method Summary

Modifier and TypeMethod and Description
public Server

Returns:

the current Server object
addVariable
(String
the name the variable to add
variableName
,
ServerVariable
a server variable used for substitution in the server's URL template.
variable
)

Adds the given server variable item to the Server's map of variables.

public default Server

Returns:

Server instance with the set description property.
description
(String
an optional string describing the host designated by the URL
description
)

This method sets the description property of a Server instance to the given description parameter and returns the modified instance.

public String

Returns:

String description
getDescription
()

This method returns the description property of Server instance.

public String

Returns:

String url
getUrl
()

This method returns the url property of Server instance, which is a URL to the target host.

public Map<String, ServerVariable>

Returns:

map of server variables (potentially immutable).
getVariables
()

This method returns the variables property of Server instance.

public void
removeVariable(String
the name the variable to remove
variableName
)

Removes the given server variable item from the Server's map of variables

public void
setDescription(String
an optional string describing the host designated by the URL
description
)

This method sets the description property of a Server instance to the given description parameter.

public void
setUrl(String
a URL to the target host
url
)

This method sets the url property of Server instance to the given url argument, representing a URL to the target host.

public void
setVariables(Map<String, ServerVariable>
a map between variable name and its value
variables
)

This method sets the variables property of Server instance to the given variables argument.

public default Server

Returns:

Server instance with the set url property.
url
(String
a URL to the target host
url
)

This method sets the url property of Server instance to the given url argument, representing a URL to the target host, and returns the modified instance.

public default Server

Returns:

Server instance with the set variables property.
variables
(Map<String, ServerVariable>
a map between variable name and its value
variables
)

This method sets the variables property of Server instance to the given variables argument and returns the modified instance.

Inherited from org.eclipse.microprofile.openapi.models.Extensible:
addExtensionextensionsgetExtensionsremoveExtensionsetExtensions

Method Detail

addVariableback to summary
public Server addVariable(String variableName, ServerVariable variable)

Adds the given server variable item to the Server's map of variables.

Parameters
variableName:String

the name the variable to add

variable:ServerVariable

a server variable used for substitution in the server's URL template.

Returns:Server

the current Server object

descriptionback to summary
public default Server description(String description)

This method sets the description property of a Server instance to the given description parameter and returns the modified instance.

Description of a server is an optional string describing the host designated by the URL. CommonMark syntax can be used for rich text representation.

Parameters
description:String

an optional string describing the host designated by the URL

Returns:Server

Server instance with the set description property.

getDescriptionback to summary
public String getDescription()

This method returns the description property of Server instance. The decsription property is an optional string describing the host designated by the URL.

Returns:String

String description

getUrlback to summary
public String getUrl()

This method returns the url property of Server instance, which is a URL to the target host.

This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI definition is being served. Variable substitutions will be made when a variable is named enclosed in curly brackets.

This is a REQUIRED property.

Returns:String

String url

getVariablesback to summary
public Map<String, ServerVariable> getVariables()

This method returns the variables property of Server instance.

Variables are represented as a map between variable name and its value. The value is used for substitution in the server's URL template.

Returns:Map<String, ServerVariable>

map of server variables (potentially immutable).

removeVariableback to summary
public void removeVariable(String variableName)

Removes the given server variable item from the Server's map of variables

Parameters
variableName:String

the name the variable to remove

setDescriptionback to summary
public void setDescription(String description)

This method sets the description property of a Server instance to the given description parameter.

Description of a server is an optional string describing the host designated by the URL. CommonMark syntax can be used for rich text representation.

Parameters
description:String

an optional string describing the host designated by the URL

setUrlback to summary
public void setUrl(String url)

This method sets the url property of Server instance to the given url argument, representing a URL to the target host.

This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI definition is being served. Variable substitutions will be made when a variable is named enclosed in curly brackets.

This is a REQUIRED property.

Parameters
url:String

a URL to the target host

setVariablesback to summary
public void setVariables(Map<String, ServerVariable> variables)

This method sets the variables property of Server instance to the given variables argument.

Variables property is a map between variable name and its value. The value is used for substitution in the server's URL template.

Parameters
variables:Map<String, ServerVariable>

a map between variable name and its value

urlback to summary
public default Server url(String url)

This method sets the url property of Server instance to the given url argument, representing a URL to the target host, and returns the modified instance.

This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI definition is being served. Variable substitutions will be made when a variable is named enclosed in curly brackets.

This is a REQUIRED property.

Parameters
url:String

a URL to the target host

Returns:Server

Server instance with the set url property.

variablesback to summary
public default Server variables(Map<String, ServerVariable> variables)

This method sets the variables property of Server instance to the given variables argument and returns the modified instance.

Variables property is a map between variable name and its value. The value is used for substitution in the server's URL template.

Parameters
variables:Map<String, ServerVariable>

a map between variable name and its value

Returns:Server

Server instance with the set variables property.