All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.juneau.dto.swagger.SchemaInfo Maven / Gradle / Ivy

There is a newer version: 9.0.1
Show newest version
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
// * with the License.  You may obtain a copy of the License at                                                              *
// *                                                                                                                         *
// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
// *                                                                                                                         *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
// * specific language governing permissions and limitations under the License.                                              *
// ***************************************************************************************************************************
package org.apache.juneau.dto.swagger;

import java.util.*;

import org.apache.juneau.annotation.*;

/**
 * The Schema Object allows the definition of input and output data types.
 *
 * 

* These types can be objects, but also primitives and arrays. * This object is based on the JSON Schema Specification Draft 4 and uses a predefined subset of it. * On top of this subset, there are extensions provided by this specification to allow for more complete documentation. * *

* Further information about the properties can be found in JSON Schema Core and JSON Schema Validation. * Unless stated otherwise, the property definitions follow the JSON Schema specification as referenced here. * *

Additional Information
* */ @Bean(properties="format,title,description,default,multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum,maxLength,minLength,pattern,maxItems,minItems,uniqueItems,maxProperties,minProperties,required,enum,type,items,allOf,properties,additionalProperties,discriminator,readOnly,xml,externalDocs,example") @SuppressWarnings({ "unchecked" }) public class SchemaInfo extends SwaggerElement { private String format; private String title; private String description; private Object _default; private Number multipleOf; private Number maximum; private Boolean exclusiveMaximum; private Number minimum; private Boolean exclusiveMinimum; private Integer maxLength; private Integer minLength; private String pattern; private Integer maxItems; private Integer minItems; private Boolean uniqueItems; private Integer maxProperties; private Integer minProperties; private Boolean required; private List _enum; private String type; private Items items; private List allOf; private Map> properties; private Map additionalProperties; private String discriminator; private Boolean readOnly; private Xml xml; private ExternalDocumentation externalDocs; private Object example; /** * Bean property getter: format. * *

* See Data Type Formats for further * details. * * @return The value of the format property on this bean, or null if it is not set. */ public String getFormat() { return format; } /** * Bean property setter: format. * *

* See Data Type Formats for further * details. * * @param format The new value for the format property on this bean. * @return This object (for method chaining). */ public SchemaInfo setFormat(String format) { this.format = format; return this; } /** * Synonym for {@link #setFormat(String)}. * * @param format The new value for the format property on this bean. * @return This object (for method chaining). */ public SchemaInfo format(String format) { return setFormat(format); } /** * Bean property getter: title. * * @return The value of the title property on this bean, or null if it is not set. */ public String getTitle() { return title; } /** * Bean property setter: title. * * @param title The new value for the title property on this bean. * @return This object (for method chaining). */ public SchemaInfo setTitle(String title) { this.title = title; return this; } /** * Synonym for {@link #setTitle(String)}. * * @param title The new value for the title property on this bean. * @return This object (for method chaining). */ public SchemaInfo title(String title) { return setTitle(title); } /** * Bean property getter: description. * *

* GFM syntax can be used * for rich text representation. * * @return The value of the description property on this bean, or null if it is not set. */ public String getDescription() { return description; } /** * Bean property setter: description. * *

* GFM syntax can be used * for rich text representation. * * @param description The new value for the description property on this bean. * @return This object (for method chaining). */ public SchemaInfo setDescription(String description) { this.description = description; return this; } /** * Synonym for {@link #setDescription(String)}. * * @param description The new value for the description property on this bean. * @return This object (for method chaining). */ public SchemaInfo description(String description) { return setDescription(description); } /** * Bean property getter: default. * *

* Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object. * * @return The value of the default property on this bean, or null if it is not set. */ public Object getDefault() { return _default; } /** * Bean property setter: default. * *

* Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object. * * @param _default The new value for the default property on this bean. * @return This object (for method chaining). */ public SchemaInfo setDefault(Object _default) { this._default = _default; return this; } /** * Synonym for {@link #setDefault(Object)}. * * @param _default The new value for the default property on this bean. * @return This object (for method chaining). */ public SchemaInfo _default(Object _default) { return setDefault(_default); } /** * Bean property getter: multipleOf. * * @return The value of the multipleOf property on this bean, or null if it is not set. */ public Number getMultipleOf() { return multipleOf; } /** * Bean property setter: multipleOf. * * @param multipleOf The new value for the multipleOf property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMultipleOf(Number multipleOf) { this.multipleOf = multipleOf; return this; } /** * Synonym for {@link #setMultipleOf(Number)}. * * @param multipleOf The new value for the multipleOf property on this bean. * @return This object (for method chaining). */ public SchemaInfo multipleOf(Number multipleOf) { return setMultipleOf(multipleOf); } /** * Bean property getter: maximum. * * @return The value of the maximum property on this bean, or null if it is not set. */ public Number getMaximum() { return maximum; } /** * Bean property setter: maximum. * * @param maximum The new value for the maximum property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMaximum(Number maximum) { this.maximum = maximum; return this; } /** * Synonym for {@link #setMaximum(Number)}. * * @param maximum The new value for the maximum property on this bean. * @return This object (for method chaining). */ public SchemaInfo maximum(Number maximum) { return setMaximum(maximum); } /** * Bean property getter: exclusiveMaximum. * * @return * The value of the exclusiveMaximum property on this bean, or null if it is * not set. */ public Boolean getExclusiveMaximum() { return exclusiveMaximum; } /** * Bean property setter: exclusiveMaximum. * * @param exclusiveMaximum The new value for the exclusiveMaximum property on this bean. * @return This object (for method chaining). */ public SchemaInfo setExclusiveMaximum(Boolean exclusiveMaximum) { this.exclusiveMaximum = exclusiveMaximum; return this; } /** * Synonym for {@link #setExclusiveMaximum(Boolean)}. * * @param exclusiveMaximum The new value for the exclusiveMaximum property on this bean. * @return This object (for method chaining). */ public SchemaInfo exclusiveMaximum(Boolean exclusiveMaximum) { return setExclusiveMaximum(exclusiveMaximum); } /** * Bean property getter: minimum. * * @return The value of the minimum property on this bean, or null if it is not set. */ public Number getMinimum() { return minimum; } /** * Bean property setter: minimum. * * @param minimum The new value for the minimum property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMinimum(Number minimum) { this.minimum = minimum; return this; } /** * Synonym for {@link #setMinimum(Number)}. * * @param minimum The new value for the minimum property on this bean. * @return This object (for method chaining). */ public SchemaInfo minimum(Number minimum) { return setMinimum(minimum); } /** * Bean property getter: exclusiveMinimum. * * @return * The value of the exclusiveMinimum property on this bean, or null if it is * not set. */ public Boolean getExclusiveMinimum() { return exclusiveMinimum; } /** * Bean property setter: exclusiveMinimum. * * @param exclusiveMinimum The new value for the exclusiveMinimum property on this bean. * @return This object (for method chaining). */ public SchemaInfo setExclusiveMinimum(Boolean exclusiveMinimum) { this.exclusiveMinimum = exclusiveMinimum; return this; } /** * Synonym for {@link #setExclusiveMinimum(Boolean)}. * * @param exclusiveMinimum The new value for the exclusiveMinimum property on this bean. * @return This object (for method chaining). */ public SchemaInfo exclusiveMinimum(Boolean exclusiveMinimum) { return setExclusiveMinimum(exclusiveMinimum); } /** * Bean property getter: maxLength. * * @return The value of the maxLength property on this bean, or null if it is not set. */ public Integer getMaxLength() { return maxLength; } /** * Bean property setter: maxLength. * * @param maxLength The new value for the maxLength property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMaxLength(Integer maxLength) { this.maxLength = maxLength; return this; } /** * Synonym for {@link #setMaxLength(Integer)}. * * @param maxLength The new value for the maxLength property on this bean. * @return This object (for method chaining). */ public SchemaInfo maxLength(Integer maxLength) { return setMaxLength(maxLength); } /** * Bean property getter: minLength. * * @return The value of the minLength property on this bean, or null if it is not set. */ public Integer getMinLength() { return minLength; } /** * Bean property setter: minLength. * * @param minLength The new value for the minLength property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMinLength(Integer minLength) { this.minLength = minLength; return this; } /** * Synonym for {@link #setMinLength(Integer)}. * * @param minLength The new value for the minLength property on this bean. * @return This object (for method chaining). */ public SchemaInfo minLength(Integer minLength) { return setMinLength(minLength); } /** * Bean property getter: pattern. * * @return The value of the pattern property on this bean, or null if it is not set. */ public String getPattern() { return pattern; } /** * Bean property setter: pattern. * * @param pattern The new value for the pattern property on this bean. * @return This object (for method chaining). */ public SchemaInfo setPattern(String pattern) { this.pattern = pattern; return this; } /** * Synonym for {@link #setPattern(String)}. * * @param pattern The new value for the pattern property on this bean. * @return This object (for method chaining). */ public SchemaInfo pattern(String pattern) { return setPattern(pattern); } /** * Bean property getter: maxItems. * * @return The value of the maxItems property on this bean, or null if it is not set. */ public Integer getMaxItems() { return maxItems; } /** * Bean property setter: maxItems. * * @param maxItems The new value for the maxItems property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMaxItems(Integer maxItems) { this.maxItems = maxItems; return this; } /** * Synonym for {@link #setMaxItems(Integer)}. * * @param maxItems The new value for the maxItems property on this bean. * @return This object (for method chaining). */ public SchemaInfo maxItems(Integer maxItems) { return setMaxItems(maxItems); } /** * Bean property getter: minItems. * * @return The value of the minItems property on this bean, or null if it is not set. */ public Integer getMinItems() { return minItems; } /** * Bean property setter: minItems. * * @param minItems The new value for the minItems property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMinItems(Integer minItems) { this.minItems = minItems; return this; } /** * Synonym for {@link #setMinItems(Integer)}. * * @param minItems The new value for the minItems property on this bean. * @return This object (for method chaining). */ public SchemaInfo minItems(Integer minItems) { return setMinItems(minItems); } /** * Bean property getter: uniqueItems. * * @return The value of the uniqueItems property on this bean, or null if it is not * set. */ public Boolean getUniqueItems() { return uniqueItems; } /** * Bean property setter: uniqueItems. * * @param uniqueItems The new value for the uniqueItems property on this bean. * @return This object (for method chaining). */ public SchemaInfo setUniqueItems(Boolean uniqueItems) { this.uniqueItems = uniqueItems; return this; } /** * Synonym for {@link #setUniqueItems(Boolean)}. * * @param uniqueItems The new value for the uniqueItems property on this bean. * @return This object (for method chaining). */ public SchemaInfo uniqueItems(Boolean uniqueItems) { return setUniqueItems(uniqueItems); } /** * Bean property getter: maxProperties. * * @return The value of the maxProperties property on this bean, or null if it is * not set. */ public Integer getMaxProperties() { return maxProperties; } /** * Bean property setter: maxProperties. * * @param maxProperties The new value for the maxProperties property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMaxProperties(Integer maxProperties) { this.maxProperties = maxProperties; return this; } /** * Synonym for {@link #setMaxProperties(Integer)}. * * @param maxProperties The new value for the maxProperties property on this bean. * @return This object (for method chaining). */ public SchemaInfo maxProperties(Integer maxProperties) { return setMaxProperties(maxProperties); } /** * Bean property getter: minProperties. * * @return The value of the minProperties property on this bean, or null if it is * not set. */ public Integer getMinProperties() { return minProperties; } /** * Bean property setter: minProperties. * * @param minProperties The new value for the minProperties property on this bean. * @return This object (for method chaining). */ public SchemaInfo setMinProperties(Integer minProperties) { this.minProperties = minProperties; return this; } /** * Synonym for {@link #setMinProperties(Integer)}. * * @param minProperties The new value for the minProperties property on this bean. * @return This object (for method chaining). */ public SchemaInfo minProperties(Integer minProperties) { return setMinProperties(minProperties); } /** * Bean property getter: required. * * @return The value of the required property on this bean, or null if it is not set. */ public Boolean getRequired() { return required; } /** * Bean property setter: required. * * @param required The new value for the required property on this bean. * @return This object (for method chaining). */ public SchemaInfo setRequired(Boolean required) { this.required = required; return this; } /** * Synonym for {@link #setRequired(Boolean)}. * * @param required The new value for the required property on this bean. * @return This object (for method chaining). */ public SchemaInfo required(Boolean required) { return setRequired(required); } /** * Bean property getter: enum. * * @return The value of the enum property on this bean, or null if it is not set. */ public List getEnum() { return _enum; } /** * Bean property setter: enum. * * @param _enum The new value for the enum property on this bean. * @return This object (for method chaining). */ public SchemaInfo setEnum(List _enum) { this._enum = _enum; return this; } /** * Bean property adder: enum. * * @param _enum The new values to add to the enum property on this bean. * These can either be individual objects or {@link Collection Collections} of objects. * @return This object (for method chaining). */ public SchemaInfo addEnum(Object..._enum) { for (Object o : _enum) { if (o != null) { if (o instanceof Collection) addEnum((Collection)o); else { if (this._enum == null) this._enum = new LinkedList(); this._enum.add(o); } } } return this; } /** * Synonym for {@link #addEnum(Object...)}. * * @param _enum * The new values to add to the enum property on this bean. * These can either be individual objects or {@link Collection Collections} of objects. * @return This object (for method chaining). */ public SchemaInfo _enum(Object..._enum) { return addEnum(_enum); } /** * Bean property getter: type. * * @return The value of the type property on this bean, or null if it is not set. */ public String getType() { return type; } /** * Bean property setter: type. * * @param type The new value for the type property on this bean. * @return This object (for method chaining). */ public SchemaInfo setType(String type) { this.type = type; return this; } /** * Synonym for {@link #setType(String)}. * * @param type The new value for the type property on this bean. * @return This object (for method chaining). */ public SchemaInfo type(String type) { return setType(type); } /** * Bean property getter: items. * * @return The value of the items property on this bean, or null if it is not set. */ public Items getItems() { return items; } /** * Bean property setter: items. * * @param items The new value for the items property on this bean. * @return This object (for method chaining). */ public SchemaInfo setItems(Items items) { this.items = items; return this; } /** * Synonym for {@link #setItems(Items)}. * * @param items The new value for the items property on this bean. * @return This object (for method chaining). */ public SchemaInfo items(Items items) { return setItems(items); } /** * Bean property getter: allOf. * * @return The value of the allOf property on this bean, or null if it is not set. */ public List getAllOf() { return allOf; } /** * Bean property setter: allOf. * * @param allOf The new value for the allOf property on this bean. * @return This object (for method chaining). */ public SchemaInfo setAllOf(List allOf) { this.allOf = allOf; return this; } /** * Bean property adder: enum. * * @param allOf * The new values to add to the allOf property on this bean. * These can either be individual objects or {@link Collection Collections} of objects. * @return This object (for method chaining). */ public SchemaInfo addAllOf(Object...allOf) { for (Object o : allOf) { if (o != null) { if (o instanceof Collection) addAllOf((Collection)o); else { if (this.allOf == null) this.allOf = new LinkedList(); this.allOf.add(o); } } } return this; } /** * Synonym for {@link #addAllOf(Object...)}. * * @param allOf * The new values to add to the allOf property on this bean. * These can either be individual objects or {@link Collection Collections} of objects. * @return This object (for method chaining). */ public SchemaInfo allOf(Object...allOf) { return addAllOf(allOf); } /** * Bean property getter: properties. * * @return The value of the properties property on this bean, or null if it is not set. */ public Map> getProperties() { return properties; } /** * Bean property setter: properties. * * @param properties The new value for the properties property on this bean. * @return This object (for method chaining). */ public SchemaInfo setProperties(Map> properties) { this.properties = properties; return this; } /** * Bean property setter: properties. * * @param name The property name. * @param propertyProperties The properties of the property. * @return This object (for method chaining). */ public SchemaInfo addProperty(String name, Map propertyProperties) { if (this.properties == null) this.properties = new TreeMap>(); this.properties.put(name, propertyProperties); return this; } /** * Synonym for {@link #addProperty(String,Map)}. * * @param name The property name. * @param propertyProperties The properties of the property. * @return This object (for method chaining). */ public SchemaInfo property(String name, Object...propertyProperties) { if (propertyProperties.length % 2 != 0) throw new RuntimeException("Invalid number of arguments passed to SchemaInfo.property(String,Object...)"); Map m = new LinkedHashMap(); for (int i = 0; i < propertyProperties.length; i += 2) m.put(String.valueOf(propertyProperties[i]), propertyProperties[i+1]); return addProperty(name, m); } /** * Bean property getter: additionalProperties. * * @return * The value of the additionalProperties property on this bean, or null if it * is not set. */ public Map getAdditionalProperties() { return additionalProperties; } /** * Bean property setter: additionalProperties. * * @param additionalProperties The new value for the additionalProperties property on this bean. * @return This object (for method chaining). */ public SchemaInfo setAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } /** * Synonym for {@link #setAdditionalProperties(Map)}. * * @param additionalProperties The new value for the additionalProperties property on this bean. * @return This object (for method chaining). */ public SchemaInfo additionalProperties(Object...additionalProperties) { if (additionalProperties.length % 2 != 0) throw new RuntimeException("Invalid number of arguments passed to SchemaInfo.additionalProperties(Object...)"); Map m = new LinkedHashMap(); for (int i = 0; i < additionalProperties.length; i += 2) m.put(String.valueOf(additionalProperties[i]), additionalProperties[i+1]); return setAdditionalProperties(m); } /** * Bean property getter: discriminator. * * @return * The value of the discriminator property on this bean, or null if it is * not set. */ public String getDiscriminator() { return discriminator; } /** * Bean property setter: discriminator. * * @param discriminator The new value for the discriminator property on this bean. * @return This object (for method chaining). */ public SchemaInfo setDiscriminator(String discriminator) { this.discriminator = discriminator; return this; } /** * Synonym for {@link #setDiscriminator(String)}. * * @param discriminator The new value for the discriminator property on this bean. * @return This object (for method chaining). */ public SchemaInfo discriminator(String discriminator) { return setDiscriminator(discriminator); } /** * Bean property getter: readOnly. * * @return The value of the readOnly property on this bean, or null if it is not set. */ public Boolean getReadOnly() { return readOnly; } /** * Bean property setter: readOnly. * * @param readOnly The new value for the readOnly property on this bean. * @return This object (for method chaining). */ public SchemaInfo setReadOnly(Boolean readOnly) { this.readOnly = readOnly; return this; } /** * Synonym for {@link #setReadOnly(Boolean)}. * * @param readOnly The new value for the readOnly property on this bean. * @return This object (for method chaining). */ public SchemaInfo readOnly(Boolean readOnly) { return setReadOnly(readOnly); } /** * Bean property getter: xml. * * @return The value of the xml property on this bean, or null if it is not set. */ public Xml getXml() { return xml; } /** * Bean property setter: xml. * * @param xml The new value for the xml property on this bean. * @return This object (for method chaining). */ public SchemaInfo setXml(Xml xml) { this.xml = xml; return this; } /** * Synonym for {@link #setXml(Xml)}. * * @param xml The new value for the xml property on this bean. * @return This object (for method chaining). */ public SchemaInfo xml(Xml xml) { return setXml(xml); } /** * Bean property getter: externalDocs. * * @return * The value of the externalDocs property on this bean, or null if it is not * set. */ public ExternalDocumentation getExternalDocs() { return externalDocs; } /** * Bean property setter: externalDocs. * * @param externalDocs The new value for the externalDocs property on this bean. * @return This object (for method chaining). */ public SchemaInfo setExternalDocs(ExternalDocumentation externalDocs) { this.externalDocs = externalDocs; return this; } /** * Synonym for {@link #setExternalDocs(ExternalDocumentation)}. * * @param externalDocs The new value for the externalDocs property on this bean. * @return This object (for method chaining). */ public SchemaInfo externalDocs(ExternalDocumentation externalDocs) { return setExternalDocs(externalDocs); } /** * Bean property getter: example. * * @return The value of the example property on this bean, or null if it is not set. */ public Object getExample() { return example; } /** * Bean property setter: example. * * @param example The new value for the example property on this bean. * @return This object (for method chaining). */ public SchemaInfo setExample(Object example) { this.example = example; return this; } /** * Synonym for {@link #setExample(Object)}. * * @param example The new value for the example property on this bean. * @return This object (for method chaining). */ public SchemaInfo example(Object example) { return setExample(example); } }