@Bean(properties="in,name,type,description,required,schema,format,allowEmptyValue,items,collectionFormat,default,maximum,exclusiveMaximum,minimum,exclusiveMinimum,maxLength,minLength,pattern,maxItems,minItems,uniqueItems,enum,multipleOf,x-example,x-examples,*") public class ParameterInfo extends SwaggerElement
A unique parameter is defined by a combination of a name and location.
There are five possible parameter types.
Constructor and Description |
---|
ParameterInfo()
Default constructor.
|
ParameterInfo(ParameterInfo copyFrom)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
ParameterInfo |
_default(Object value)
Same as
setDefault(Object) . |
ParameterInfo |
_enum(Object... values)
Adds one or more values to the
|
ParameterInfo |
addEnum(Collection<Object> value)
Adds one or more values to the
|
ParameterInfo |
addExamples(Map<String,String> values)
Adds one or more values to the
|
ParameterInfo |
allowEmptyValue(Object value)
Same as
setAllowEmptyValue(Boolean) . |
ParameterInfo |
collectionFormat(Object value)
Same as
setCollectionFormat(String) . |
ParameterInfo |
copy()
Make a deep copy of this object.
|
ParameterInfo |
copyFrom(ParameterInfo p)
Copies any non-null fields from the specified object to this object.
|
ParameterInfo |
description(Object value)
Same as
setDescription(String) . |
ParameterInfo |
example(Object value)
Bean property setter:
|
ParameterInfo |
example(String name,
String value)
Adds a single value to the
|
ParameterInfo |
examples(Object... values)
Adds one or more values to the
|
ParameterInfo |
exclusiveMaximum(Object value)
Same as
setExclusiveMaximum(Boolean) . |
ParameterInfo |
exclusiveMinimum(Object value)
Same as
setExclusiveMinimum(Boolean) . |
ParameterInfo |
format(Object value)
Same as
setFormat(String) . |
<T> T |
get(String property,
Class<T> type)
Generic property getter.
|
Boolean |
getAllowEmptyValue()
Bean property getter:
|
String |
getCollectionFormat()
Bean property getter:
|
Object |
getDefault()
Bean property getter:
|
String |
getDescription()
Bean property getter:
|
List<Object> |
getEnum()
Bean property getter:
|
String |
getExample()
Bean property getter:
|
Map<String,String> |
getExamples()
Bean property getter:
|
Boolean |
getExclusiveMaximum()
Bean property getter:
|
Boolean |
getExclusiveMinimum()
Bean property getter:
|
String |
getFormat()
Bean property getter:
|
String |
getIn()
Bean property getter:
|
Items |
getItems()
Bean property getter:
|
Number |
getMaximum()
Bean property getter:
|
Integer |
getMaxItems()
Bean property getter:
|
Integer |
getMaxLength()
Bean property getter:
|
Number |
getMinimum()
Bean property getter:
|
Integer |
getMinItems()
Bean property getter:
|
Integer |
getMinLength()
Bean property getter:
|
Number |
getMultipleOf()
Bean property getter:
|
String |
getName()
Bean property getter:
|
String |
getPattern()
Bean property getter:
|
Boolean |
getRequired()
Bean property getter:
|
SchemaInfo |
getSchema()
Bean property getter:
|
String |
getType()
Bean property getter:
|
Boolean |
getUniqueItems()
Bean property getter:
|
ParameterInfo |
in(Object value)
Same as
setIn(String) . |
ParameterInfo |
items(Object value)
Same as
setItems(Items) . |
Set<String> |
keySet()
Returns all the keys on this element.
|
ParameterInfo |
maximum(Object value)
Same as
setMaximum(Number) . |
ParameterInfo |
maxItems(Object value)
Same as
setMaxItems(Integer) . |
ParameterInfo |
maxLength(Object value)
Same as
setMaxLength(Integer) . |
ParameterInfo |
minimum(Object value)
Same as
setMinimum(Number) . |
ParameterInfo |
minItems(Object value)
Same as
setMinItems(Integer) . |
ParameterInfo |
minLength(Object value)
Same as
setMinLength(Integer) . |
ParameterInfo |
multipleOf(Object value)
Same as
setMultipleOf(Number) . |
ParameterInfo |
name(Object value)
Same as
setName(String) . |
ParameterInfo |
pattern(Object value)
Same as
setPattern(String) . |
ParameterInfo |
required(Object value)
Same as
setRequired(Boolean) . |
ParameterInfo |
resolveRefs(Swagger swagger,
Deque<String> refStack,
int maxDepth)
Resolves any
|
ParameterInfo |
schema(Object value)
Same as
setSchema(SchemaInfo) . |
ParameterInfo |
set(String property,
Object value)
Generic property setter.
|
ParameterInfo |
setAllowEmptyValue(Boolean value)
Bean property setter:
|
ParameterInfo |
setCollectionFormat(String value)
Bean property setter:
|
ParameterInfo |
setDefault(Object value)
Bean property setter:
|
ParameterInfo |
setDescription(String value)
Bean property setter:
|
ParameterInfo |
setEnum(Collection<Object> value)
Bean property setter:
|
ParameterInfo |
setExample(String value)
Bean property setter:
|
ParameterInfo |
setExamples(Map<String,String> value)
Bean property setter:
|
ParameterInfo |
setExclusiveMaximum(Boolean value)
Bean property setter:
|
ParameterInfo |
setExclusiveMinimum(Boolean value)
Bean property setter:
|
ParameterInfo |
setFormat(String value)
Bean property setter:
|
ParameterInfo |
setIn(String value)
Bean property setter:
|
ParameterInfo |
setItems(Items value)
Bean property setter:
|
ParameterInfo |
setMaximum(Number value)
Bean property setter:
|
ParameterInfo |
setMaxItems(Integer value)
Bean property setter:
|
ParameterInfo |
setMaxLength(Integer value)
Bean property setter:
|
ParameterInfo |
setMinimum(Number value)
Bean property setter:
|
ParameterInfo |
setMinItems(Integer value)
Bean property setter:
|
ParameterInfo |
setMinLength(Integer value)
Bean property setter:
|
ParameterInfo |
setMultipleOf(Number value)
Bean property setter:
|
ParameterInfo |
setName(String value)
Bean property setter:
|
ParameterInfo |
setPattern(String value)
Bean property setter:
|
ParameterInfo |
setRequired(Boolean value)
Bean property setter:
|
ParameterInfo |
setSchema(SchemaInfo value)
Bean property setter:
|
ParameterInfo |
setType(String value)
Bean property setter:
|
ParameterInfo |
setUniqueItems(Boolean value)
Bean property setter:
|
protected ParameterInfo |
strict()
Sets strict mode on this bean.
|
ParameterInfo |
type(Object value)
Same as
setType(String) . |
ParameterInfo |
uniqueItems(Object value)
Same as
setUniqueItems(Boolean) . |
public ParameterInfo()
public ParameterInfo(ParameterInfo copyFrom)
copyFrom
- The object to copy.public ParameterInfo copy()
protected ParameterInfo strict()
SwaggerElement
strict
in class SwaggerElement
public ParameterInfo copyFrom(ParameterInfo p)
p
- The object to copy fields from.
public String getName()
The name of the parameter.
public ParameterInfo setName(String value)
The name of the parameter.
value
- The new value for this property.
public ParameterInfo name(Object value)
setName(String)
.value
- The new value for this property.
public String getIn()
The location of the parameter.
public ParameterInfo setIn(String value)
The location of the parameter.
value
- The new value for this property.
public ParameterInfo in(Object value)
setIn(String)
.value
- The new value for this property.
public String getDescription()
A brief description of the parameter.
This could contain examples of use.
public ParameterInfo setDescription(String value)
A brief description of the parameter.
This could contain examples of use.
value
- The new value for this property.
public ParameterInfo description(Object value)
setDescription(String)
.value
- The new value for this property.
public Boolean getRequired()
Determines whether this parameter is mandatory.
public ParameterInfo setRequired(Boolean value)
Determines whether this parameter is mandatory.
value
- The new value for this property.
public ParameterInfo required(Object value)
setRequired(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public SchemaInfo getSchema()
The schema defining the type used for the body parameter.
public ParameterInfo setSchema(SchemaInfo value)
The schema defining the type used for the body parameter.
value
- The new value for this property.
public ParameterInfo schema(Object value)
setSchema(SchemaInfo)
.value
- The new value for this property.
SchemaInfo
SchemaInfo
schema(
public String getType()
The type of the parameter.
public ParameterInfo setType(String value)
value
- The new value for this property.
public ParameterInfo type(Object value)
setType(String)
.value
- The new value for this property.
public String getFormat()
The extending format for the previously mentioned type.
public ParameterInfo setFormat(String value)
The extending format for the previously mentioned type.
value
- The new value for this property.public ParameterInfo format(Object value)
setFormat(String)
.value
- The new value for this property.
public Boolean getAllowEmptyValue()
Sets the ability to pass empty-valued parameters.
This is valid only for either
public ParameterInfo setAllowEmptyValue(Boolean value)
Sets the ability to pass empty-valued parameters.
This is valid only for either
value
- The new value for this property.
public ParameterInfo allowEmptyValue(Object value)
setAllowEmptyValue(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public Items getItems()
Describes the type of items in the array.
public ParameterInfo setItems(Items value)
Describes the type of items in the array.
value
- The new value for this property.
public ParameterInfo items(Object value)
setItems(Items)
.public String getCollectionFormat()
Determines the format of the array if type array is used.
public ParameterInfo setCollectionFormat(String value)
Determines the format of the array if type array is used.
value
- The new value for this property.
public ParameterInfo collectionFormat(Object value)
setCollectionFormat(String)
.value
- The new value for this property.
public Object getDefault()
Declares the value of the parameter that the server will use if none is provided, for example a
public ParameterInfo setDefault(Object value)
Declares the value of the parameter that the server will use if none is provided, for example a
value
- The new value for this property.public ParameterInfo _default(Object value)
setDefault(Object)
.value
- The new value for this property.public Number getMaximum()
public ParameterInfo setMaximum(Number value)
value
- The new value for this property.public ParameterInfo maximum(Object value)
setMaximum(Number)
.value
- The new value for this property.
public Boolean getExclusiveMaximum()
public ParameterInfo setExclusiveMaximum(Boolean value)
value
- The new value for this property.public ParameterInfo exclusiveMaximum(Object value)
setExclusiveMaximum(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public Number getMinimum()
public ParameterInfo setMinimum(Number value)
value
- The new value for this property.public ParameterInfo minimum(Object value)
setMinimum(Number)
.value
- The new value for this property.
public Boolean getExclusiveMinimum()
public ParameterInfo setExclusiveMinimum(Boolean value)
value
- The new value for this property.public ParameterInfo exclusiveMinimum(Object value)
setExclusiveMinimum(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public Integer getMaxLength()
public ParameterInfo setMaxLength(Integer value)
value
- The new value for this property.public ParameterInfo maxLength(Object value)
setMaxLength(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public Integer getMinLength()
public ParameterInfo setMinLength(Integer value)
value
- The new value for this property.public ParameterInfo minLength(Object value)
setMinLength(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public String getPattern()
public ParameterInfo setPattern(String value)
This string SHOULD be a valid regular expression.
value
- The new value for this property.public ParameterInfo pattern(Object value)
setPattern(String)
.value
- The new value for this property.
public Integer getMaxItems()
public ParameterInfo setMaxItems(Integer value)
value
- The new value for this property.public ParameterInfo maxItems(Object value)
setMaxItems(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public Integer getMinItems()
public ParameterInfo setMinItems(Integer value)
value
- The new value for this property.public ParameterInfo minItems(Object value)
setMinItems(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public Boolean getUniqueItems()
public ParameterInfo setUniqueItems(Boolean value)
value
- The new value for this property.public ParameterInfo uniqueItems(Object value)
setUniqueItems(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public List<Object> getEnum()
public ParameterInfo setEnum(Collection<Object> value)
value
- The new value for this property.
public ParameterInfo addEnum(Collection<Object> value)
value
- The values to add to this property.
public ParameterInfo _enum(Object... values)
values
- The values to add to this property.
_enum(
_enum(
public Number getMultipleOf()
public ParameterInfo setMultipleOf(Number value)
value
- The new value for this property.
public ParameterInfo multipleOf(Object value)
setMultipleOf(Number)
.value
- The new value for this property.
@BeanProperty(value="x-example") public String getExample()
@BeanProperty(value="x-example") public ParameterInfo setExample(String value)
value
- The new value for this property.
public ParameterInfo example(Object value)
value
- The property value.@BeanProperty(value="x-examples") public Map<String,String> getExamples()
@BeanProperty(value="x-examples") public ParameterInfo setExamples(Map<String,String> value)
value
- The new value for this property.
public ParameterInfo addExamples(Map<String,String> values)
values
- The values to add to this property.
public ParameterInfo example(String name, String value)
name
- The extra property name.value
- The extra property value.public ParameterInfo examples(Object... values)
values
- The values to add to this property.
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 ParameterInfo 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 ParameterInfo 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.
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.