Interface APIResponse
-
- All Superinterfaces:
Constructible
,Extensible<APIResponse>
,Reference<APIResponse>
public interface APIResponse extends Constructible, Extensible<APIResponse>, Reference<APIResponse>
This interface represents a single response from an API Operation, including design-time, static links to operations based on the response.- See Also:
- "https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responseObject"
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description APIResponse
addHeader(java.lang.String name, Header header)
Adds the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse.APIResponse
addLink(java.lang.String name, Link link)
Adds a link to this instance of ApiResponse using the given name and Link, and returns this ApiResponse instance.default APIResponse
content(Content content)
Sets the map containing descriptions of potential response payload for this instance of ApiResponse and returns this ApiResponse instance.default APIResponse
description(java.lang.String description)
Sets the description of this instance of ApiResponse and returns this ApiResponse instance.Content
getContent()
Returns the map containing descriptions of potential response payload for this instance of ApiResponse.java.lang.String
getDescription()
Returns a short description of this instance of ApiResponse.java.util.Map<java.lang.String,Header>
getHeaders()
Returns the map of Headers in this instance of ApiResponse.java.util.Map<java.lang.String,Link>
getLinks()
Returns the operations links that can be followed from tis instance of ApiResponse.default APIResponse
headers(java.util.Map<java.lang.String,Header> headers)
Sets the Headers for this instance of ApiResponse with the given map of Headers and returns this instance of ApiResponse.default APIResponse
links(java.util.Map<java.lang.String,Link> links)
Sets the operations links that can be followed from this instance of ApiResponse.void
removeHeader(java.lang.String name)
Removes the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse.void
removeLink(java.lang.String name)
Removes a link to this instance of ApiResponse using the given name and Link.void
setContent(Content content)
Sets the map containing descriptions of potential response payload for this instance of ApiResponse.void
setDescription(java.lang.String description)
Sets the description of this instance of ApiResponse.void
setHeaders(java.util.Map<java.lang.String,Header> headers)
Sets the Headers for this instance of ApiResponse with the given map of Headers.void
setLinks(java.util.Map<java.lang.String,Link> links)
Sets the operations links that can be followed from this instance of ApiResponse.-
Methods inherited from interface org.eclipse.microprofile.openapi.models.Extensible
addExtension, extensions, getExtensions, removeExtension, setExtensions
-
-
-
-
Method Detail
-
getDescription
java.lang.String getDescription()
Returns a short description of this instance of ApiResponse.- Returns:
- a short description of the response
-
setDescription
void setDescription(java.lang.String description)
Sets the description of this instance of ApiResponse.- Parameters:
description
- a short description of the response
-
description
default APIResponse description(java.lang.String description)
Sets the description of this instance of ApiResponse and returns this ApiResponse instance.- Parameters:
description
- a short description of the response- Returns:
- this ApiResponse instance
-
getHeaders
java.util.Map<java.lang.String,Header> getHeaders()
Returns the map of Headers in this instance of ApiResponse.- Returns:
- the headers of this response
-
setHeaders
void setHeaders(java.util.Map<java.lang.String,Header> headers)
Sets the Headers for this instance of ApiResponse with the given map of Headers. The Header names are case insensitive and if a Header is defined with the name 'Content-Type', then it will be ignored.- Parameters:
headers
- the headers of the response
-
headers
default APIResponse headers(java.util.Map<java.lang.String,Header> headers)
Sets the Headers for this instance of ApiResponse with the given map of Headers and returns this instance of ApiResponse. The Header names are case insensitive and if a Header is defined with the name 'Content-Type', then it will be ignored.- Parameters:
headers
- the headers of the response- Returns:
- this ApiResponse instance
-
addHeader
APIResponse addHeader(java.lang.String name, Header header)
Adds the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse. If this ApiResponse instance does not have any headers, a new map is created and the given header is added.- Parameters:
name
- the unique name of the headerheader
- a header for the response. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- this ApiResponse instance
-
removeHeader
void removeHeader(java.lang.String name)
Removes the given Header to this ApiResponse instance's map of Headers with the given name and return this instance of ApiResponse. If this ApiResponse instance does not have any headers, a new map is created and the given header is added.- Parameters:
name
- the unique name of the header
-
getContent
Content getContent()
Returns the map containing descriptions of potential response payload for this instance of ApiResponse.- Returns:
- the potential content of the response
-
setContent
void setContent(Content content)
Sets the map containing descriptions of potential response payload for this instance of ApiResponse.- Parameters:
content
- the potential content of the response
-
content
default APIResponse content(Content content)
Sets the map containing descriptions of potential response payload for this instance of ApiResponse and returns this ApiResponse instance.- Parameters:
content
- the potential content of the response- Returns:
- this ApiResponse instance
-
getLinks
java.util.Map<java.lang.String,Link> getLinks()
Returns the operations links that can be followed from tis instance of ApiResponse.- Returns:
- operation links that can be followed from the response
-
setLinks
void setLinks(java.util.Map<java.lang.String,Link> links)
Sets the operations links that can be followed from this instance of ApiResponse.- Parameters:
links
- the operation links followed from the response
-
links
default APIResponse links(java.util.Map<java.lang.String,Link> links)
Sets the operations links that can be followed from this instance of ApiResponse.- Parameters:
links
- the operation links followed from the response- Returns:
- current APIResponse instance
-
addLink
APIResponse addLink(java.lang.String name, Link link)
Adds a link to this instance of ApiResponse using the given name and Link, and returns this ApiResponse instance.- Parameters:
name
- the short name of the linklink
- the operation link that can be followed from the response. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- this ApiResponse instance
-
removeLink
void removeLink(java.lang.String name)
Removes a link to this instance of ApiResponse using the given name and Link.- Parameters:
name
- the short name of the link
-
-