@Bean(properties="description,schema,headers,x-example,examples,*") public class ResponseInfo extends SwaggerElement
Constructor and Description |
---|
ResponseInfo()
Default constructor.
|
ResponseInfo(ResponseInfo copyFrom)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
ResponseInfo |
addExamples(Map<String,Object> values)
Adds one or more values to the
|
ResponseInfo |
addHeaders(Map<String,HeaderInfo> values)
Adds one or more values to the
|
ResponseInfo |
copy()
Make a deep copy of this object.
|
ResponseInfo |
copyFrom(ResponseInfo r)
Copies any non-null fields from the specified object to this object.
|
ResponseInfo |
description(Object value)
Same as
setDescription(String) . |
ResponseInfo |
example(Object value)
Bean property setter:
|
ResponseInfo |
example(String mimeType,
Object example)
Adds a single value to the
|
ResponseInfo |
examples(Object... values)
Adds one or more values to the
|
<T> T |
get(String property,
Class<T> type)
Generic property getter.
|
String |
getDescription()
Bean property getter:
|
Object |
getExample()
Bean property getter:
|
Map<String,Object> |
getExamples()
Bean property getter:
|
HeaderInfo |
getHeader(String name)
Returns the header information with the specified name.
|
Map<String,HeaderInfo> |
getHeaders()
Bean property getter:
|
SchemaInfo |
getSchema()
Bean property getter:
|
boolean |
hasHeaders()
Returns
|
ResponseInfo |
header(String name,
HeaderInfo header)
Adds a single value to the
|
ResponseInfo |
headers(Object... values)
Adds one or more values to the
|
Set<String> |
keySet()
Returns all the keys on this element.
|
ResponseInfo |
resolveRefs(Swagger swagger,
Deque<String> refStack,
int maxDepth)
Resolves any
|
ResponseInfo |
schema(Object value)
Same as
setSchema(SchemaInfo) . |
ResponseInfo |
set(String property,
Object value)
Generic property setter.
|
ResponseInfo |
setDescription(String value)
Bean property setter:
|
ResponseInfo |
setExample(Object value)
Bean property setter:
|
ResponseInfo |
setExamples(Map<String,Object> value)
Bean property setter:
|
ResponseInfo |
setHeaders(Map<String,HeaderInfo> value)
Bean property setter:
|
ResponseInfo |
setSchema(SchemaInfo value)
Bean property setter:
|
asMap, extraKeys, get, getExtraProperties, isStrict, strict, strict, toString
public ResponseInfo()
public ResponseInfo(ResponseInfo copyFrom)
copyFrom
- The object to copy.public ResponseInfo copy()
public ResponseInfo copyFrom(ResponseInfo r)
r
- The object to copy fields from.
public String getDescription()
A short description of the response.
public ResponseInfo setDescription(String value)
A short description of the response.
value
- The new value for this property.
public ResponseInfo description(Object value)
setDescription(String)
.value
- The new value for this property.
toString()
.
public SchemaInfo getSchema()
A definition of the response structure.
public ResponseInfo setSchema(SchemaInfo value)
A definition of the response structure.
value
- The new value for this property.
public ResponseInfo schema(Object value)
setSchema(SchemaInfo)
.value
- The new value for this property.
SchemaInfo
String
- JSON object representation of SchemaInfo
schema(
public Map<String,HeaderInfo> getHeaders()
A list of headers that are sent with the response.
public ResponseInfo setHeaders(Map<String,HeaderInfo> value)
A list of headers that are sent with the response.
value
- The new value for this property.
public ResponseInfo addHeaders(Map<String,HeaderInfo> values)
values
- The values to add to this property.
public ResponseInfo header(String name, HeaderInfo header)
name
- The header name.header
- The header descriptionspublic ResponseInfo headers(Object... values)
values
- The values to add to this property.
Map<String,HeaderInfo
|String>
String
- JSON object representation of Map<String,HeaderInfo
>
headers(
public HeaderInfo getHeader(String name)
name
- The header name.@BeanProperty(value="x-example") public Object getExample()
@BeanProperty(value="x-example") public ResponseInfo setExample(Object value)
value
- The new value for this property.
public ResponseInfo example(Object value)
value
- The property value.public Map<String,Object> getExamples()
An example of the response message.
public ResponseInfo setExamples(Map<String,Object> value)
An example of the response message.
value
- The new value for this property.
public ResponseInfo addExamples(Map<String,Object> values)
values
- The values to add to this property.
public ResponseInfo example(String mimeType, Object example)
mimeType
- The mime-type string.example
- The example.public ResponseInfo examples(Object... values)
values
- The values to add to this property.
Map<String,Object>
String
- JSON object representation of Map<String,Object>
examples(
public <T> T get(String property, Class<T> type)
SwaggerElement
Can be used to retrieve non-standard Swagger fields such as
get
in class SwaggerElement
property
- The property name to retrieve.type
- The datatype to cast the value to.public ResponseInfo set(String property, Object value)
SwaggerElement
Can be used to set non-standard Swagger fields such as
set
in class SwaggerElement
property
- The property name to set.value
- The new value for the property.public Set<String> keySet()
SwaggerElement
keySet
in class SwaggerElement
public boolean hasHeaders()
public ResponseInfo resolveRefs(Swagger swagger, Deque<String> refStack, int maxDepth)
swagger
- The swagger document containing the definitions.refStack
- Keeps track of previously-visited references so that we don't cause recursive loops.maxDepth
- The maximum depth to resolve references.
$ref
references will be left alone.
Copyright © 2018 Apache. All rights reserved.