public class HttpPartSchemaBuilder extends Object
HttpPartSchema
objects.Constructor and Description |
---|
HttpPartSchemaBuilder() |
public HttpPartSchemaBuilder()
public HttpPartSchema build()
HttpPartSchema
object based on the configuration of this builder.
This method can be called multiple times to produce new schema objects.
HttpPartSchema
object.
public HttpPartSchemaBuilder apply(Annotation a)
a
- The annotation to apply.public HttpPartSchemaBuilder name(String value)
value
- The new value for this property.public HttpPartSchemaBuilder codes(int[] value)
value
- The new value for this property.
public HttpPartSchemaBuilder code(int value)
value
- The new value for this property.
public HttpPartSchemaBuilder required(Boolean value)
Determines whether the parameter is mandatory.
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder required(String value)
Determines whether the parameter is mandatory.
Same as required(Boolean)
but takes in a boolean value as a string.
value
- The new value for this property.
public HttpPartSchemaBuilder required()
Shortcut for calling required(
.
public HttpPartSchemaBuilder type(String value)
The type of the parameter.
The possible values are:
ObjectList
.
ObjectMap
.
If the type is not specified, it will be auto-detected based on the parameter class type.
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder format(String value)
The extending format for the previously mentioned parameter type.
The possible values are:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder allowEmptyValue(Boolean value)
Sets the ability to pass empty-valued parameters.
This is valid only for either query or formData parameters and allows you to send a parameter with a name only or an empty value.
The default value is
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder allowEmptyValue(String value)
Same as allowEmptyValue(Boolean)
but takes in a string boolean value.
value
- The new value for this property.
public HttpPartSchemaBuilder allowEmptyValue()
Shortcut for calling allowEmptyValue(
.
public HttpPartSchemaBuilder items(HttpPartSchemaBuilder value)
Describes the type of items in the array.
Required if
Can only be used if
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder collectionFormat(String value)
Determines the format of the array if
Can only be used if
Possible values are:
Applicable to the following Swagger schema objects:
Note that for collections/arrays parameters with POJO element types, the input is broken into a string array before being converted into POJO elements.
value
- The new value for this property.
public HttpPartSchemaBuilder _default(String value)
Declares the value of the parameter that the server will use if none is provided, for example a "count" to control the number of results per page might default to 100 if not supplied by the client in the request.
(Note: "default" has no meaning for required parameters.)
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder maximum(Number value)
Defines the maximum value for a parameter of numeric types.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder exclusiveMaximum(Boolean value)
Defines whether the maximum is matched exclusively.
Only allowed for the following types:
If
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder exclusiveMaximum(String value)
Same as exclusiveMaximum(Boolean)
but takes in a string boolean value.
value
- The new value for this property.
public HttpPartSchemaBuilder exclusiveMaximum()
Shortcut for calling exclusiveMaximum(
.
public HttpPartSchemaBuilder minimum(Number value)
Defines the minimum value for a parameter of numeric types.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder exclusiveMinimum(Boolean value)
Defines whether the minimum is matched exclusively.
Only allowed for the following types:
If
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder exclusiveMinimum(String value)
Same as exclusiveMinimum(Boolean)
but takes in a string boolean value.
value
- The new value for this property.
public HttpPartSchemaBuilder exclusiveMinimum()
Shortcut for calling exclusiveMinimum(
.
public HttpPartSchemaBuilder maxLength(Long value)
A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
The length of a string instance is defined as the number of its characters as defined by RFC 4627.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder maxLength(String value)
Same as maxLength(Long)
but takes in a string number.
value
- The new value for this property.
public HttpPartSchemaBuilder minLength(Long value)
A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
The length of a string instance is defined as the number of its characters as defined by RFC 4627.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder minLength(String value)
Same as minLength(Long)
but takes in a string number.
value
- The new value for this property.
public HttpPartSchemaBuilder pattern(String value)
A string input is valid if it matches the specified regular expression pattern.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder maxItems(Long value)
An array or collection is valid if its size is less than, or equal to, the value of this keyword.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder maxItems(String value)
Same as maxItems(Long)
but takes in a string number.
value
- The new value for this property.
public HttpPartSchemaBuilder minItems(Long value)
An array or collection is valid if its size is greater than, or equal to, the value of this keyword.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder minItems(String value)
Same as minItems(Long)
but takes in a string number.
value
- The new value for this property.
public HttpPartSchemaBuilder uniqueItems(Boolean value)
If
If the parameter type is a subclass of Set
, this validation is skipped (since a set can only contain unique items anyway).
Otherwise, the collection or array is checked for duplicate items.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder uniqueItems(String value)
Same as uniqueItems(Boolean)
but takes in a string boolean.
value
- The new value for this property.
public HttpPartSchemaBuilder uniqueItems()
Shortcut for calling uniqueItems(
.
public HttpPartSchemaBuilder skipIfEmpty(Boolean value)
Identifies whether an item should be skipped during serialization if it's empty.
value
- The new value for this property.
public HttpPartSchemaBuilder skipIfEmpty(String value)
Same as skipIfEmpty(Boolean)
but takes in a string boolean.
value
- The new value for this property.
public HttpPartSchemaBuilder skipIfEmpty()
Shortcut for calling skipIfEmpty(
.
public HttpPartSchemaBuilder _enum(Set<String> value)
If specified, the input validates successfully if it is equal to one of the elements in this array.
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder _enum(String... values)
Same as _enum(Set)
but takes in a var-args array.
values
- The new values for this property.
public HttpPartSchemaBuilder multipleOf(Number value)
A numeric instance is valid if the result of the division of the instance by this keyword's value is an integer.
Only allowed for the following types:
Applicable to the following Swagger schema objects:
value
- The new value for this property.
public HttpPartSchemaBuilder maxProperties(Long value)
value
- The new value for this property.
public HttpPartSchemaBuilder maxProperties(String value)
Same as maxProperties(Long)
but takes in a string number.
value
- The new value for this property.
public HttpPartSchemaBuilder minProperties(Long value)
value
- The new value for this property.
public HttpPartSchemaBuilder minProperties(String value)
Same as minProperties(Long)
but takes in a string boolean.
value
- The new value for this property.
public HttpPartSchemaBuilder property(String key, HttpPartSchemaBuilder value)
key
- The property name.value
- The new value for this property.
public HttpPartSchemaBuilder additionalProperties(HttpPartSchemaBuilder value)
value
- The new value for this property.
public HttpPartSchemaBuilder serializer(Class<? extends HttpPartSerializer> value)
value
- The new value for this property.
HttpPartSerializer.Null
.public HttpPartSchemaBuilder parser(Class<? extends HttpPartParser> value)
value
- The new value for this property.
HttpPartParser.Null
.public HttpPartSchemaBuilder noValidate(Boolean value)
value
- Specify ContextRuntimeException
from being thrown if invalid Swagger usage was detected.public HttpPartSchemaBuilder noValidate()
Shortcut for calling noValidate(
.
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.