diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 9d0793fe775..4e9af1007bd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -55,7 +55,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.{{name}} = {{name}}; } - {{#isListContainer}} + {{#isArray}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -72,8 +72,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; return this; } - {{/isListContainer}} - {{#isMapContainer}} + {{/isArray}} + {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -90,7 +90,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; return this; } - {{/isMapContainer}} + {{/isMap}} {{/vars}} @Override diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 61bec1b6ff4..4ebb303b837 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,6 +55,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapString = mapString; } + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap(); + } + + this.mapString.put(key, mapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { + if (mapStringItem != null && this.mapString != null) { + this.mapString.remove(mapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapNumber(Map mapNumber) { @@ -76,6 +92,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapNumber = mapNumber; } + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap(); + } + + this.mapNumber.put(key, mapNumberItem); + return this; + } + + public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { + if (mapNumberItem != null && this.mapNumber != null) { + this.mapNumber.remove(mapNumberItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapInteger(Map mapInteger) { @@ -97,6 +129,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapInteger = mapInteger; } + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap(); + } + + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { + if (mapIntegerItem != null && this.mapInteger != null) { + this.mapInteger.remove(mapIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { @@ -118,6 +166,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap(); + } + + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { + if (mapBooleanItem != null && this.mapBoolean != null) { + this.mapBoolean.remove(mapBooleanItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { @@ -139,6 +203,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap>(); + } + + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { + if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { + this.mapArrayInteger.remove(mapArrayIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { @@ -160,6 +240,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap>(); + } + + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { + if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(mapArrayAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapString(Map> mapMapString) { @@ -181,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapString = mapMapString; } + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap>(); + } + + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { + if (mapMapStringItem != null && this.mapMapString != null) { + this.mapMapString.remove(mapMapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { @@ -202,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap>(); + } + + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { + if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { + this.mapMapAnytype.remove(mapMapAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass anytype1(Object anytype1) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index cbca7de2f69..e4dc1fd6837 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayNumber = arrayArrayNumber; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List arrayArrayNumberItem) { + if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) { + this.arrayArrayNumber.remove(arrayArrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ad7cc3db32e..19e29e9703b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayNumber = arrayNumber; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + + this.arrayNumber.add(arrayNumberItem); + return this; + } + + public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) { + if (arrayNumberItem != null && this.arrayNumber != null) { + this.arrayNumber.remove(arrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java index f2b7469f65c..bda8bb29dc8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java @@ -46,6 +46,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayOfString = arrayOfString; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) { + if (arrayOfStringItem != null && this.arrayOfString != null) { + this.arrayOfString.remove(arrayOfStringItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { @@ -67,6 +83,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } + + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + public ArrayTest removeArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) { + this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { @@ -88,6 +120,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfModel = arrayArrayOfModel; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } + + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + public ArrayTest removeArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) { + this.arrayArrayOfModel.remove(arrayArrayOfModelItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java index bf05c76fd9e..f9f302e48cc 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,6 +131,22 @@ public enum ArrayEnumEnum { this.arrayEnum = arrayEnum; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } + + this.arrayEnum.add(arrayEnumItem); + return this; + } + + public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (arrayEnumItem != null && this.arrayEnum != null) { + this.arrayEnum.remove(arrayEnumItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 05ff7b2ea24..6828ddc9bd4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -66,6 +66,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.files = files; } + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + + this.files.add(filesItem); + return this; + } + + public FileSchemaTestClass removeFilesItem(ModelFile filesItem) { + if (filesItem != null && this.files != null) { + this.files.remove(filesItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java index f5c57914a90..fe54c2dbaf1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java @@ -80,6 +80,22 @@ public enum InnerEnum { this.mapMapOfString = mapMapOfString; } + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } + + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { + if (mapMapOfStringItem != null && this.mapMapOfString != null) { + this.mapMapOfString.remove(mapMapOfStringItem); + } + + return this; + } /** **/ public MapTest mapOfEnumString(Map mapOfEnumString) { @@ -101,6 +117,22 @@ public enum InnerEnum { this.mapOfEnumString = mapOfEnumString; } + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } + + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { + if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { + this.mapOfEnumString.remove(mapOfEnumStringItem); + } + + return this; + } /** **/ public MapTest directMap(Map directMap) { @@ -122,6 +154,22 @@ public enum InnerEnum { this.directMap = directMap; } + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + + this.directMap.put(key, directMapItem); + return this; + } + + public MapTest removeDirectMapItem(Boolean directMapItem) { + if (directMapItem != null && this.directMap != null) { + this.directMap.remove(directMapItem); + } + + return this; + } /** **/ public MapTest indirectMap(Map indirectMap) { @@ -143,6 +191,22 @@ public enum InnerEnum { this.indirectMap = indirectMap; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + + this.indirectMap.put(key, indirectMapItem); + return this; + } + + public MapTest removeIndirectMapItem(Boolean indirectMapItem) { + if (indirectMapItem != null && this.indirectMap != null) { + this.indirectMap.remove(indirectMapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 77464620e9c..54bbb7ca2f0 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -91,6 +91,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.map = map; } + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } + + this.map.put(key, mapItem); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { + if (mapItem != null && this.map != null) { + this.map.remove(mapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java index 7162d94b3b8..b35574db4cd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java @@ -152,6 +152,22 @@ public enum StatusEnum { this.photoUrls = photoUrls; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet(); + } + + this.photoUrls.add(photoUrlsItem); + return this; + } + + public Pet removePhotoUrlsItem(String photoUrlsItem) { + if (photoUrlsItem != null && this.photoUrls != null) { + this.photoUrls.remove(photoUrlsItem); + } + + return this; + } /** **/ public Pet tags(List tags) { @@ -173,6 +189,22 @@ public enum StatusEnum { this.tags = tags; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + + this.tags.add(tagsItem); + return this; + } + + public Pet removeTagsItem(Tag tagsItem) { + if (tagsItem != null && this.tags != null) { + this.tags.remove(tagsItem); + } + + return this; + } /** * pet status in the store **/ diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a093d79a6d6..1d7658a94fa 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -137,6 +137,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderDefault removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java index daaffc8af45..cdb7058acec 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -160,6 +160,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderExample removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java index 241ebb4e1bc..8e593b39392 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java @@ -156,6 +156,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.wrappedArray = wrappedArray; } + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList(); + } + + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + public XmlItem removeWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArrayItem != null && this.wrappedArray != null) { + this.wrappedArray.remove(wrappedArrayItem); + } + + return this; + } /** **/ public XmlItem nameString(String nameString) { @@ -261,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameArray = nameArray; } + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList(); + } + + this.nameArray.add(nameArrayItem); + return this; + } + + public XmlItem removeNameArrayItem(Integer nameArrayItem) { + if (nameArrayItem != null && this.nameArray != null) { + this.nameArray.remove(nameArrayItem); + } + + return this; + } /** **/ public XmlItem nameWrappedArray(List nameWrappedArray) { @@ -282,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameWrappedArray = nameWrappedArray; } + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList(); + } + + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + public XmlItem removeNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArrayItem != null && this.nameWrappedArray != null) { + this.nameWrappedArray.remove(nameWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixString(String prefixString) { @@ -387,6 +435,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixArray = prefixArray; } + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList(); + } + + this.prefixArray.add(prefixArrayItem); + return this; + } + + public XmlItem removePrefixArrayItem(Integer prefixArrayItem) { + if (prefixArrayItem != null && this.prefixArray != null) { + this.prefixArray.remove(prefixArrayItem); + } + + return this; + } /** **/ public XmlItem prefixWrappedArray(List prefixWrappedArray) { @@ -408,6 +472,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList(); + } + + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + public XmlItem removePrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArrayItem != null && this.prefixWrappedArray != null) { + this.prefixWrappedArray.remove(prefixWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceString(String namespaceString) { @@ -513,6 +593,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceArray = namespaceArray; } + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList(); + } + + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + public XmlItem removeNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArrayItem != null && this.namespaceArray != null) { + this.namespaceArray.remove(namespaceArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { @@ -534,6 +630,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList(); + } + + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + public XmlItem removeNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArrayItem != null && this.namespaceWrappedArray != null) { + this.namespaceWrappedArray.remove(namespaceWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsString(String prefixNsString) { @@ -639,6 +751,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsArray = prefixNsArray; } + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList(); + } + + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + public XmlItem removePrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArrayItem != null && this.prefixNsArray != null) { + this.prefixNsArray.remove(prefixNsArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { @@ -660,6 +788,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsWrappedArray = prefixNsWrappedArray; } + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList(); + } + + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + public XmlItem removePrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArrayItem != null && this.prefixNsWrappedArray != null) { + this.prefixNsWrappedArray.remove(prefixNsWrappedArrayItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 61bec1b6ff4..4ebb303b837 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,6 +55,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapString = mapString; } + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap(); + } + + this.mapString.put(key, mapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { + if (mapStringItem != null && this.mapString != null) { + this.mapString.remove(mapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapNumber(Map mapNumber) { @@ -76,6 +92,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapNumber = mapNumber; } + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap(); + } + + this.mapNumber.put(key, mapNumberItem); + return this; + } + + public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { + if (mapNumberItem != null && this.mapNumber != null) { + this.mapNumber.remove(mapNumberItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapInteger(Map mapInteger) { @@ -97,6 +129,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapInteger = mapInteger; } + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap(); + } + + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { + if (mapIntegerItem != null && this.mapInteger != null) { + this.mapInteger.remove(mapIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { @@ -118,6 +166,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap(); + } + + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { + if (mapBooleanItem != null && this.mapBoolean != null) { + this.mapBoolean.remove(mapBooleanItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { @@ -139,6 +203,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap>(); + } + + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { + if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { + this.mapArrayInteger.remove(mapArrayIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { @@ -160,6 +240,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap>(); + } + + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { + if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(mapArrayAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapString(Map> mapMapString) { @@ -181,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapString = mapMapString; } + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap>(); + } + + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { + if (mapMapStringItem != null && this.mapMapString != null) { + this.mapMapString.remove(mapMapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { @@ -202,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap>(); + } + + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { + if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { + this.mapMapAnytype.remove(mapMapAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass anytype1(Object anytype1) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index cbca7de2f69..e4dc1fd6837 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayNumber = arrayArrayNumber; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List arrayArrayNumberItem) { + if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) { + this.arrayArrayNumber.remove(arrayArrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ad7cc3db32e..19e29e9703b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayNumber = arrayNumber; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + + this.arrayNumber.add(arrayNumberItem); + return this; + } + + public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) { + if (arrayNumberItem != null && this.arrayNumber != null) { + this.arrayNumber.remove(arrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java index f2b7469f65c..bda8bb29dc8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java @@ -46,6 +46,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayOfString = arrayOfString; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) { + if (arrayOfStringItem != null && this.arrayOfString != null) { + this.arrayOfString.remove(arrayOfStringItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { @@ -67,6 +83,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } + + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + public ArrayTest removeArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) { + this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { @@ -88,6 +120,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfModel = arrayArrayOfModel; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } + + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + public ArrayTest removeArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) { + this.arrayArrayOfModel.remove(arrayArrayOfModelItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java index bf05c76fd9e..f9f302e48cc 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,6 +131,22 @@ public enum ArrayEnumEnum { this.arrayEnum = arrayEnum; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } + + this.arrayEnum.add(arrayEnumItem); + return this; + } + + public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (arrayEnumItem != null && this.arrayEnum != null) { + this.arrayEnum.remove(arrayEnumItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 05ff7b2ea24..6828ddc9bd4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -66,6 +66,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.files = files; } + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + + this.files.add(filesItem); + return this; + } + + public FileSchemaTestClass removeFilesItem(ModelFile filesItem) { + if (filesItem != null && this.files != null) { + this.files.remove(filesItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java index f5c57914a90..fe54c2dbaf1 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java @@ -80,6 +80,22 @@ public enum InnerEnum { this.mapMapOfString = mapMapOfString; } + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } + + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { + if (mapMapOfStringItem != null && this.mapMapOfString != null) { + this.mapMapOfString.remove(mapMapOfStringItem); + } + + return this; + } /** **/ public MapTest mapOfEnumString(Map mapOfEnumString) { @@ -101,6 +117,22 @@ public enum InnerEnum { this.mapOfEnumString = mapOfEnumString; } + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } + + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { + if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { + this.mapOfEnumString.remove(mapOfEnumStringItem); + } + + return this; + } /** **/ public MapTest directMap(Map directMap) { @@ -122,6 +154,22 @@ public enum InnerEnum { this.directMap = directMap; } + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + + this.directMap.put(key, directMapItem); + return this; + } + + public MapTest removeDirectMapItem(Boolean directMapItem) { + if (directMapItem != null && this.directMap != null) { + this.directMap.remove(directMapItem); + } + + return this; + } /** **/ public MapTest indirectMap(Map indirectMap) { @@ -143,6 +191,22 @@ public enum InnerEnum { this.indirectMap = indirectMap; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + + this.indirectMap.put(key, indirectMapItem); + return this; + } + + public MapTest removeIndirectMapItem(Boolean indirectMapItem) { + if (indirectMapItem != null && this.indirectMap != null) { + this.indirectMap.remove(indirectMapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 77464620e9c..54bbb7ca2f0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -91,6 +91,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.map = map; } + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } + + this.map.put(key, mapItem); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { + if (mapItem != null && this.map != null) { + this.map.remove(mapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index 7162d94b3b8..b35574db4cd 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -152,6 +152,22 @@ public enum StatusEnum { this.photoUrls = photoUrls; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet(); + } + + this.photoUrls.add(photoUrlsItem); + return this; + } + + public Pet removePhotoUrlsItem(String photoUrlsItem) { + if (photoUrlsItem != null && this.photoUrls != null) { + this.photoUrls.remove(photoUrlsItem); + } + + return this; + } /** **/ public Pet tags(List tags) { @@ -173,6 +189,22 @@ public enum StatusEnum { this.tags = tags; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + + this.tags.add(tagsItem); + return this; + } + + public Pet removeTagsItem(Tag tagsItem) { + if (tagsItem != null && this.tags != null) { + this.tags.remove(tagsItem); + } + + return this; + } /** * pet status in the store **/ diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a093d79a6d6..1d7658a94fa 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -137,6 +137,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderDefault removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java index daaffc8af45..cdb7058acec 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -160,6 +160,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderExample removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java index 241ebb4e1bc..8e593b39392 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java @@ -156,6 +156,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.wrappedArray = wrappedArray; } + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList(); + } + + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + public XmlItem removeWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArrayItem != null && this.wrappedArray != null) { + this.wrappedArray.remove(wrappedArrayItem); + } + + return this; + } /** **/ public XmlItem nameString(String nameString) { @@ -261,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameArray = nameArray; } + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList(); + } + + this.nameArray.add(nameArrayItem); + return this; + } + + public XmlItem removeNameArrayItem(Integer nameArrayItem) { + if (nameArrayItem != null && this.nameArray != null) { + this.nameArray.remove(nameArrayItem); + } + + return this; + } /** **/ public XmlItem nameWrappedArray(List nameWrappedArray) { @@ -282,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameWrappedArray = nameWrappedArray; } + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList(); + } + + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + public XmlItem removeNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArrayItem != null && this.nameWrappedArray != null) { + this.nameWrappedArray.remove(nameWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixString(String prefixString) { @@ -387,6 +435,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixArray = prefixArray; } + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList(); + } + + this.prefixArray.add(prefixArrayItem); + return this; + } + + public XmlItem removePrefixArrayItem(Integer prefixArrayItem) { + if (prefixArrayItem != null && this.prefixArray != null) { + this.prefixArray.remove(prefixArrayItem); + } + + return this; + } /** **/ public XmlItem prefixWrappedArray(List prefixWrappedArray) { @@ -408,6 +472,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList(); + } + + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + public XmlItem removePrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArrayItem != null && this.prefixWrappedArray != null) { + this.prefixWrappedArray.remove(prefixWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceString(String namespaceString) { @@ -513,6 +593,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceArray = namespaceArray; } + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList(); + } + + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + public XmlItem removeNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArrayItem != null && this.namespaceArray != null) { + this.namespaceArray.remove(namespaceArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { @@ -534,6 +630,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList(); + } + + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + public XmlItem removeNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArrayItem != null && this.namespaceWrappedArray != null) { + this.namespaceWrappedArray.remove(namespaceWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsString(String prefixNsString) { @@ -639,6 +751,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsArray = prefixNsArray; } + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList(); + } + + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + public XmlItem removePrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArrayItem != null && this.prefixNsArray != null) { + this.prefixNsArray.remove(prefixNsArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { @@ -660,6 +788,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsWrappedArray = prefixNsWrappedArray; } + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList(); + } + + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + public XmlItem removePrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArrayItem != null && this.prefixNsWrappedArray != null) { + this.prefixNsWrappedArray.remove(prefixNsWrappedArrayItem); + } + + return this; + } @Override public boolean equals(Object o) {