Changes lingering isMapContainer to isMap (#7747)

* Changes lingering isMapContainer to isMap

* Adds ensure up to date updates
This commit is contained in:
Justin Black 2020-10-18 20:07:33 -07:00 committed by GitHub
parent fed9d0637a
commit 2ee0913d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 314 additions and 2 deletions

View File

@ -146,7 +146,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
{{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vendorExtensions.x-is-jackson-optional-nullable}}
} }
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMap}}
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
{{#vendorExtensions.x-is-jackson-optional-nullable}} {{#vendorExtensions.x-is-jackson-optional-nullable}}
@ -170,7 +170,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
return this; return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vendorExtensions.x-is-jackson-optional-nullable}}
} }
{{/isMapContainer}} {{/isMap}}
{{/isReadOnly}} {{/isReadOnly}}
/** /**

View File

@ -89,6 +89,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
if (this.mapString == null) {
this.mapString = new HashMap<>();
}
this.mapString.put(key, mapStringItem);
return this;
}
/** /**
* Get mapString * Get mapString
* @return mapString * @return mapString
@ -113,6 +121,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
if (this.mapNumber == null) {
this.mapNumber = new HashMap<>();
}
this.mapNumber.put(key, mapNumberItem);
return this;
}
/** /**
* Get mapNumber * Get mapNumber
* @return mapNumber * @return mapNumber
@ -137,6 +153,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
if (this.mapInteger == null) {
this.mapInteger = new HashMap<>();
}
this.mapInteger.put(key, mapIntegerItem);
return this;
}
/** /**
* Get mapInteger * Get mapInteger
* @return mapInteger * @return mapInteger
@ -161,6 +185,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
if (this.mapBoolean == null) {
this.mapBoolean = new HashMap<>();
}
this.mapBoolean.put(key, mapBooleanItem);
return this;
}
/** /**
* Get mapBoolean * Get mapBoolean
* @return mapBoolean * @return mapBoolean
@ -185,6 +217,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
if (this.mapArrayInteger == null) {
this.mapArrayInteger = new HashMap<>();
}
this.mapArrayInteger.put(key, mapArrayIntegerItem);
return this;
}
/** /**
* Get mapArrayInteger * Get mapArrayInteger
* @return mapArrayInteger * @return mapArrayInteger
@ -209,6 +249,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
if (this.mapArrayAnytype == null) {
this.mapArrayAnytype = new HashMap<>();
}
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
return this;
}
/** /**
* Get mapArrayAnytype * Get mapArrayAnytype
* @return mapArrayAnytype * @return mapArrayAnytype
@ -233,6 +281,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
if (this.mapMapString == null) {
this.mapMapString = new HashMap<>();
}
this.mapMapString.put(key, mapMapStringItem);
return this;
}
/** /**
* Get mapMapString * Get mapMapString
* @return mapMapString * @return mapMapString
@ -257,6 +313,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
if (this.mapMapAnytype == null) {
this.mapMapAnytype = new HashMap<>();
}
this.mapMapAnytype.put(key, mapMapAnytypeItem);
return this;
}
/** /**
* Get mapMapAnytype * Get mapMapAnytype
* @return mapMapAnytype * @return mapMapAnytype

View File

@ -95,6 +95,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
if (this.mapMapOfString == null) {
this.mapMapOfString = new HashMap<>();
}
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
}
/** /**
* Get mapMapOfString * Get mapMapOfString
* @return mapMapOfString * @return mapMapOfString
@ -119,6 +127,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
if (this.mapOfEnumString == null) {
this.mapOfEnumString = new HashMap<>();
}
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
}
/** /**
* Get mapOfEnumString * Get mapOfEnumString
* @return mapOfEnumString * @return mapOfEnumString
@ -143,6 +159,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<>();
}
this.directMap.put(key, directMapItem);
return this;
}
/** /**
* Get directMap * Get directMap
* @return directMap * @return directMap
@ -167,6 +191,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
if (this.indirectMap == null) {
this.indirectMap = new HashMap<>();
}
this.indirectMap.put(key, indirectMapItem);
return this;
}
/** /**
* Get indirectMap * Get indirectMap
* @return indirectMap * @return indirectMap

View File

@ -107,6 +107,14 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
return this; return this;
} }
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
if (this.map == null) {
this.map = new HashMap<>();
}
this.map.put(key, mapItem);
return this;
}
/** /**
* Get map * Get map
* @return map * @return map

View File

@ -89,6 +89,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
if (this.mapString == null) {
this.mapString = new HashMap<>();
}
this.mapString.put(key, mapStringItem);
return this;
}
/** /**
* Get mapString * Get mapString
* @return mapString * @return mapString
@ -113,6 +121,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
if (this.mapNumber == null) {
this.mapNumber = new HashMap<>();
}
this.mapNumber.put(key, mapNumberItem);
return this;
}
/** /**
* Get mapNumber * Get mapNumber
* @return mapNumber * @return mapNumber
@ -137,6 +153,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
if (this.mapInteger == null) {
this.mapInteger = new HashMap<>();
}
this.mapInteger.put(key, mapIntegerItem);
return this;
}
/** /**
* Get mapInteger * Get mapInteger
* @return mapInteger * @return mapInteger
@ -161,6 +185,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
if (this.mapBoolean == null) {
this.mapBoolean = new HashMap<>();
}
this.mapBoolean.put(key, mapBooleanItem);
return this;
}
/** /**
* Get mapBoolean * Get mapBoolean
* @return mapBoolean * @return mapBoolean
@ -185,6 +217,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
if (this.mapArrayInteger == null) {
this.mapArrayInteger = new HashMap<>();
}
this.mapArrayInteger.put(key, mapArrayIntegerItem);
return this;
}
/** /**
* Get mapArrayInteger * Get mapArrayInteger
* @return mapArrayInteger * @return mapArrayInteger
@ -209,6 +249,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
if (this.mapArrayAnytype == null) {
this.mapArrayAnytype = new HashMap<>();
}
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
return this;
}
/** /**
* Get mapArrayAnytype * Get mapArrayAnytype
* @return mapArrayAnytype * @return mapArrayAnytype
@ -233,6 +281,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
if (this.mapMapString == null) {
this.mapMapString = new HashMap<>();
}
this.mapMapString.put(key, mapMapStringItem);
return this;
}
/** /**
* Get mapMapString * Get mapMapString
* @return mapMapString * @return mapMapString
@ -257,6 +313,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
if (this.mapMapAnytype == null) {
this.mapMapAnytype = new HashMap<>();
}
this.mapMapAnytype.put(key, mapMapAnytypeItem);
return this;
}
/** /**
* Get mapMapAnytype * Get mapMapAnytype
* @return mapMapAnytype * @return mapMapAnytype

View File

@ -95,6 +95,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
if (this.mapMapOfString == null) {
this.mapMapOfString = new HashMap<>();
}
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
}
/** /**
* Get mapMapOfString * Get mapMapOfString
* @return mapMapOfString * @return mapMapOfString
@ -119,6 +127,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
if (this.mapOfEnumString == null) {
this.mapOfEnumString = new HashMap<>();
}
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
}
/** /**
* Get mapOfEnumString * Get mapOfEnumString
* @return mapOfEnumString * @return mapOfEnumString
@ -143,6 +159,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<>();
}
this.directMap.put(key, directMapItem);
return this;
}
/** /**
* Get directMap * Get directMap
* @return directMap * @return directMap
@ -167,6 +191,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
if (this.indirectMap == null) {
this.indirectMap = new HashMap<>();
}
this.indirectMap.put(key, indirectMapItem);
return this;
}
/** /**
* Get indirectMap * Get indirectMap
* @return indirectMap * @return indirectMap

View File

@ -107,6 +107,14 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
return this; return this;
} }
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
if (this.map == null) {
this.map = new HashMap<>();
}
this.map.put(key, mapItem);
return this;
}
/** /**
* Get map * Get map
* @return map * @return map

View File

@ -79,6 +79,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
if (this.mapProperty == null) {
this.mapProperty = new HashMap<>();
}
this.mapProperty.put(key, mapPropertyItem);
return this;
}
/** /**
* Get mapProperty * Get mapProperty
* @return mapProperty * @return mapProperty
@ -103,6 +111,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
if (this.mapOfMapProperty == null) {
this.mapOfMapProperty = new HashMap<>();
}
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
return this;
}
/** /**
* Get mapOfMapProperty * Get mapOfMapProperty
* @return mapOfMapProperty * @return mapOfMapProperty
@ -209,6 +225,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(String key, Object mapWithUndeclaredPropertiesAnytype3Item) {
if (this.mapWithUndeclaredPropertiesAnytype3 == null) {
this.mapWithUndeclaredPropertiesAnytype3 = new HashMap<>();
}
this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item);
return this;
}
/** /**
* Get mapWithUndeclaredPropertiesAnytype3 * Get mapWithUndeclaredPropertiesAnytype3
* @return mapWithUndeclaredPropertiesAnytype3 * @return mapWithUndeclaredPropertiesAnytype3
@ -257,6 +281,14 @@ public class AdditionalPropertiesClass {
return this; return this;
} }
public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String key, String mapWithUndeclaredPropertiesStringItem) {
if (this.mapWithUndeclaredPropertiesString == null) {
this.mapWithUndeclaredPropertiesString = new HashMap<>();
}
this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem);
return this;
}
/** /**
* Get mapWithUndeclaredPropertiesString * Get mapWithUndeclaredPropertiesString
* @return mapWithUndeclaredPropertiesString * @return mapWithUndeclaredPropertiesString

View File

@ -95,6 +95,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
if (this.mapMapOfString == null) {
this.mapMapOfString = new HashMap<>();
}
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
}
/** /**
* Get mapMapOfString * Get mapMapOfString
* @return mapMapOfString * @return mapMapOfString
@ -119,6 +127,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
if (this.mapOfEnumString == null) {
this.mapOfEnumString = new HashMap<>();
}
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
}
/** /**
* Get mapOfEnumString * Get mapOfEnumString
* @return mapOfEnumString * @return mapOfEnumString
@ -143,6 +159,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<>();
}
this.directMap.put(key, directMapItem);
return this;
}
/** /**
* Get directMap * Get directMap
* @return directMap * @return directMap
@ -167,6 +191,14 @@ public class MapTest {
return this; return this;
} }
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
if (this.indirectMap == null) {
this.indirectMap = new HashMap<>();
}
this.indirectMap.put(key, indirectMapItem);
return this;
}
/** /**
* Get indirectMap * Get indirectMap
* @return indirectMap * @return indirectMap

View File

@ -107,6 +107,14 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
return this; return this;
} }
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
if (this.map == null) {
this.map = new HashMap<>();
}
this.map.put(key, mapItem);
return this;
}
/** /**
* Get map * Get map
* @return map * @return map

View File

@ -431,6 +431,18 @@ public class NullableClass extends HashMap<String, Object> {
return this; return this;
} }
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectNullableProp.get().put(key, objectNullablePropItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/** /**
* Get objectNullableProp * Get objectNullableProp
* @return objectNullableProp * @return objectNullableProp
@ -465,6 +477,18 @@ public class NullableClass extends HashMap<String, Object> {
return this; return this;
} }
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/** /**
* Get objectAndItemsNullableProp * Get objectAndItemsNullableProp
* @return objectAndItemsNullableProp * @return objectAndItemsNullableProp
@ -499,6 +523,14 @@ public class NullableClass extends HashMap<String, Object> {
return this; return this;
} }
public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) {
if (this.objectItemsNullable == null) {
this.objectItemsNullable = new HashMap<>();
}
this.objectItemsNullable.put(key, objectItemsNullableItem);
return this;
}
/** /**
* Get objectItemsNullable * Get objectItemsNullable
* @return objectItemsNullable * @return objectItemsNullable