forked from loafle/openapi-generator-original
Remove the option to support JDK7 from Java generator and templates (#11547)
* remove java8 from java client generator and templates * update tests * remove threetenbp * update spring templates to remove java8 * remove java8 from jaxrs template * fix jaxrs spec * fix feign * remove CustomInstantDeserializer.java * fix jersey1 * fix undertow * various update * fix jaxrs jersey1 * fix java inflector * fix jaxrs cxf * add new files * update doc
This commit is contained in:
@@ -9,7 +9,6 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@SpringBootApplication
|
||||
@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
|
||||
@@ -38,7 +37,7 @@ public class OpenAPI2SpringBoot implements CommandLineRunner {
|
||||
|
||||
@Bean
|
||||
public WebMvcConfigurer webConfigurer() {
|
||||
return new WebMvcConfigurerAdapter() {
|
||||
return new WebMvcConfigurer() {
|
||||
/*@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
|
||||
@@ -9,10 +9,10 @@ import java.math.BigDecimal;
|
||||
import org.openapitools.model.Client;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.openapitools.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
import org.openapitools.model.ModelApiResponse;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.model.OuterComposite;
|
||||
import org.openapitools.model.User;
|
||||
import org.openapitools.model.XmlItem;
|
||||
|
||||
@@ -4,10 +4,10 @@ import java.math.BigDecimal;
|
||||
import org.openapitools.model.Client;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.openapitools.model.FileSchemaTestClass;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
import org.openapitools.model.ModelApiResponse;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.model.OuterComposite;
|
||||
import org.openapitools.model.User;
|
||||
import org.openapitools.model.XmlItem;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import java.util.List;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.model.User;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.openapitools.api;
|
||||
|
||||
import java.util.List;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.model.User;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
@@ -1,232 +0,0 @@
|
||||
package org.openapitools.configuration;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonTokenId;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
|
||||
import org.threeten.bp.DateTimeException;
|
||||
import org.threeten.bp.DateTimeUtils;
|
||||
import org.threeten.bp.Instant;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.threeten.bp.ZoneId;
|
||||
import org.threeten.bp.ZonedDateTime;
|
||||
import org.threeten.bp.format.DateTimeFormatter;
|
||||
import org.threeten.bp.temporal.Temporal;
|
||||
import org.threeten.bp.temporal.TemporalAccessor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s.
|
||||
* Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format.
|
||||
*
|
||||
* @author Nick Williams
|
||||
*/
|
||||
public class CustomInstantDeserializer<T extends Temporal>
|
||||
extends ThreeTenDateTimeDeserializerBase<T> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(
|
||||
Instant.class, DateTimeFormatter.ISO_INSTANT,
|
||||
new Function<TemporalAccessor, Instant>() {
|
||||
@Override
|
||||
public Instant apply(TemporalAccessor temporalAccessor) {
|
||||
return Instant.from(temporalAccessor);
|
||||
}
|
||||
},
|
||||
new Function<FromIntegerArguments, Instant>() {
|
||||
@Override
|
||||
public Instant apply(FromIntegerArguments a) {
|
||||
return Instant.ofEpochMilli(a.value);
|
||||
}
|
||||
},
|
||||
new Function<FromDecimalArguments, Instant>() {
|
||||
@Override
|
||||
public Instant apply(FromDecimalArguments a) {
|
||||
return Instant.ofEpochSecond(a.integer, a.fraction);
|
||||
}
|
||||
},
|
||||
null
|
||||
);
|
||||
|
||||
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(
|
||||
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
|
||||
new Function<TemporalAccessor, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
|
||||
return OffsetDateTime.from(temporalAccessor);
|
||||
}
|
||||
},
|
||||
new Function<FromIntegerArguments, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(FromIntegerArguments a) {
|
||||
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
|
||||
}
|
||||
},
|
||||
new Function<FromDecimalArguments, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(FromDecimalArguments a) {
|
||||
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
|
||||
}
|
||||
},
|
||||
new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
|
||||
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(
|
||||
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
|
||||
new Function<TemporalAccessor, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
|
||||
return ZonedDateTime.from(temporalAccessor);
|
||||
}
|
||||
},
|
||||
new Function<FromIntegerArguments, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(FromIntegerArguments a) {
|
||||
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
|
||||
}
|
||||
},
|
||||
new Function<FromDecimalArguments, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(FromDecimalArguments a) {
|
||||
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
|
||||
}
|
||||
},
|
||||
new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
|
||||
return zonedDateTime.withZoneSameInstant(zoneId);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
protected final Function<FromIntegerArguments, T> fromMilliseconds;
|
||||
|
||||
protected final Function<FromDecimalArguments, T> fromNanoseconds;
|
||||
|
||||
protected final Function<TemporalAccessor, T> parsedToValue;
|
||||
|
||||
protected final BiFunction<T, ZoneId, T> adjust;
|
||||
|
||||
protected CustomInstantDeserializer(Class<T> supportedType,
|
||||
DateTimeFormatter parser,
|
||||
Function<TemporalAccessor, T> parsedToValue,
|
||||
Function<FromIntegerArguments, T> fromMilliseconds,
|
||||
Function<FromDecimalArguments, T> fromNanoseconds,
|
||||
BiFunction<T, ZoneId, T> adjust) {
|
||||
super(supportedType, parser);
|
||||
this.parsedToValue = parsedToValue;
|
||||
this.fromMilliseconds = fromMilliseconds;
|
||||
this.fromNanoseconds = fromNanoseconds;
|
||||
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
|
||||
@Override
|
||||
public T apply(T t, ZoneId zoneId) {
|
||||
return t;
|
||||
}
|
||||
} : adjust;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
|
||||
super((Class<T>) base.handledType(), f);
|
||||
parsedToValue = base.parsedToValue;
|
||||
fromMilliseconds = base.fromMilliseconds;
|
||||
fromNanoseconds = base.fromNanoseconds;
|
||||
adjust = base.adjust;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
|
||||
if (dtf == _formatter) {
|
||||
return this;
|
||||
}
|
||||
return new CustomInstantDeserializer<T>(this, dtf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
|
||||
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
|
||||
//string values have to be adjusted to the configured TZ.
|
||||
switch (parser.getCurrentTokenId()) {
|
||||
case JsonTokenId.ID_NUMBER_FLOAT: {
|
||||
BigDecimal value = parser.getDecimalValue();
|
||||
long seconds = value.longValue();
|
||||
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
|
||||
return fromNanoseconds.apply(new FromDecimalArguments(
|
||||
seconds, nanoseconds, getZone(context)));
|
||||
}
|
||||
|
||||
case JsonTokenId.ID_NUMBER_INT: {
|
||||
long timestamp = parser.getLongValue();
|
||||
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
|
||||
return this.fromNanoseconds.apply(new FromDecimalArguments(
|
||||
timestamp, 0, this.getZone(context)
|
||||
));
|
||||
}
|
||||
return this.fromMilliseconds.apply(new FromIntegerArguments(
|
||||
timestamp, this.getZone(context)
|
||||
));
|
||||
}
|
||||
|
||||
case JsonTokenId.ID_STRING: {
|
||||
String string = parser.getText().trim();
|
||||
if (string.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
if (string.endsWith("+0000")) {
|
||||
string = string.substring(0, string.length() - 5) + "Z";
|
||||
}
|
||||
T value;
|
||||
try {
|
||||
TemporalAccessor acc = _formatter.parse(string);
|
||||
value = parsedToValue.apply(acc);
|
||||
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
|
||||
return adjust.apply(value, this.getZone(context));
|
||||
}
|
||||
} catch (DateTimeException e) {
|
||||
throw _peelDTE(e);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw context.mappingException("Expected type float, integer, or string.");
|
||||
}
|
||||
|
||||
private ZoneId getZone(DeserializationContext context) {
|
||||
// Instants are always in UTC, so don't waste compute cycles
|
||||
return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone());
|
||||
}
|
||||
|
||||
private static class FromIntegerArguments {
|
||||
public final long value;
|
||||
public final ZoneId zoneId;
|
||||
|
||||
private FromIntegerArguments(long value, ZoneId zoneId) {
|
||||
this.value = value;
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
}
|
||||
|
||||
private static class FromDecimalArguments {
|
||||
public final long integer;
|
||||
public final int fraction;
|
||||
public final ZoneId zoneId;
|
||||
|
||||
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
|
||||
this.integer = integer;
|
||||
this.fraction = fraction;
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
|
||||
if (this.mapString == null) {
|
||||
this.mapString = new HashMap<String, String>();
|
||||
this.mapString = new HashMap<>();
|
||||
}
|
||||
this.mapString.put(key, mapStringItem);
|
||||
return this;
|
||||
@@ -99,7 +99,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
|
||||
if (this.mapNumber == null) {
|
||||
this.mapNumber = new HashMap<String, BigDecimal>();
|
||||
this.mapNumber = new HashMap<>();
|
||||
}
|
||||
this.mapNumber.put(key, mapNumberItem);
|
||||
return this;
|
||||
@@ -126,7 +126,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
|
||||
if (this.mapInteger == null) {
|
||||
this.mapInteger = new HashMap<String, Integer>();
|
||||
this.mapInteger = new HashMap<>();
|
||||
}
|
||||
this.mapInteger.put(key, mapIntegerItem);
|
||||
return this;
|
||||
@@ -153,7 +153,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
|
||||
if (this.mapBoolean == null) {
|
||||
this.mapBoolean = new HashMap<String, Boolean>();
|
||||
this.mapBoolean = new HashMap<>();
|
||||
}
|
||||
this.mapBoolean.put(key, mapBooleanItem);
|
||||
return this;
|
||||
@@ -180,7 +180,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
|
||||
if (this.mapArrayInteger == null) {
|
||||
this.mapArrayInteger = new HashMap<String, List<Integer>>();
|
||||
this.mapArrayInteger = new HashMap<>();
|
||||
}
|
||||
this.mapArrayInteger.put(key, mapArrayIntegerItem);
|
||||
return this;
|
||||
@@ -207,7 +207,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
|
||||
if (this.mapArrayAnytype == null) {
|
||||
this.mapArrayAnytype = new HashMap<String, List<Object>>();
|
||||
this.mapArrayAnytype = new HashMap<>();
|
||||
}
|
||||
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
|
||||
return this;
|
||||
@@ -234,7 +234,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
|
||||
if (this.mapMapString == null) {
|
||||
this.mapMapString = new HashMap<String, Map<String, String>>();
|
||||
this.mapMapString = new HashMap<>();
|
||||
}
|
||||
this.mapMapString.put(key, mapMapStringItem);
|
||||
return this;
|
||||
@@ -261,7 +261,7 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
|
||||
if (this.mapMapAnytype == null) {
|
||||
this.mapMapAnytype = new HashMap<String, Map<String, Object>>();
|
||||
this.mapMapAnytype = new HashMap<>();
|
||||
}
|
||||
this.mapMapAnytype.put(key, mapMapAnytypeItem);
|
||||
return this;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
|
||||
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||
if (this.arrayArrayNumber == null) {
|
||||
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
|
||||
this.arrayArrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||
return this;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ArrayOfNumberOnly {
|
||||
|
||||
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||
if (this.arrayNumber == null) {
|
||||
this.arrayNumber = new ArrayList<BigDecimal>();
|
||||
this.arrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayNumber.add(arrayNumberItem);
|
||||
return this;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||
if (this.arrayOfString == null) {
|
||||
this.arrayOfString = new ArrayList<String>();
|
||||
this.arrayOfString = new ArrayList<>();
|
||||
}
|
||||
this.arrayOfString.add(arrayOfStringItem);
|
||||
return this;
|
||||
@@ -69,7 +69,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||
if (this.arrayArrayOfInteger == null) {
|
||||
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
|
||||
this.arrayArrayOfInteger = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||
return this;
|
||||
@@ -96,7 +96,7 @@ public class ArrayTest {
|
||||
|
||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
if (this.arrayArrayOfModel == null) {
|
||||
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
|
||||
this.arrayArrayOfModel = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||
return this;
|
||||
|
||||
@@ -126,7 +126,7 @@ public class EnumArrays {
|
||||
|
||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||
if (this.arrayEnum == null) {
|
||||
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||
this.arrayEnum = new ArrayList<>();
|
||||
}
|
||||
this.arrayEnum.add(arrayEnumItem);
|
||||
return this;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class FileSchemaTestClass {
|
||||
|
||||
public FileSchemaTestClass addFilesItem(File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<File>();
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
|
||||
@@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
||||
if (this.mapMapOfString == null) {
|
||||
this.mapMapOfString = new HashMap<String, Map<String, String>>();
|
||||
this.mapMapOfString = new HashMap<>();
|
||||
}
|
||||
this.mapMapOfString.put(key, mapMapOfStringItem);
|
||||
return this;
|
||||
@@ -109,7 +109,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
||||
if (this.mapOfEnumString == null) {
|
||||
this.mapOfEnumString = new HashMap<String, InnerEnum>();
|
||||
this.mapOfEnumString = new HashMap<>();
|
||||
}
|
||||
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
||||
return this;
|
||||
@@ -136,7 +136,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
|
||||
if (this.directMap == null) {
|
||||
this.directMap = new HashMap<String, Boolean>();
|
||||
this.directMap = new HashMap<>();
|
||||
}
|
||||
this.directMap.put(key, directMapItem);
|
||||
return this;
|
||||
@@ -163,7 +163,7 @@ public class MapTest {
|
||||
|
||||
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
|
||||
if (this.indirectMap == null) {
|
||||
this.indirectMap = new HashMap<String, Boolean>();
|
||||
this.indirectMap = new HashMap<>();
|
||||
}
|
||||
this.indirectMap.put(key, indirectMapItem);
|
||||
return this;
|
||||
|
||||
@@ -6,13 +6,13 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.openapitools.model.Animal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
||||
if (this.map == null) {
|
||||
this.map = new HashMap<String, Animal>();
|
||||
this.map = new HashMap<>();
|
||||
}
|
||||
this.map.put(key, mapItem);
|
||||
return this;
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Pet {
|
||||
|
||||
@JsonProperty("photoUrls")
|
||||
@Valid
|
||||
private Set<String> photoUrls = new LinkedHashSet<String>();
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
@JsonProperty("tags")
|
||||
@Valid
|
||||
@@ -149,7 +149,7 @@ public class Pet {
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
if (this.photoUrls == null) {
|
||||
this.photoUrls = new LinkedHashSet<String>();
|
||||
this.photoUrls = new LinkedHashSet<>();
|
||||
}
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
@@ -177,7 +177,7 @@ public class Pet {
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
if (this.tags == null) {
|
||||
this.tags = new ArrayList<Tag>();
|
||||
this.tags = new ArrayList<>();
|
||||
}
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class TypeHolderDefault {
|
||||
|
||||
@JsonProperty("array_item")
|
||||
@Valid
|
||||
private List<Integer> arrayItem = new ArrayList<Integer>();
|
||||
private List<Integer> arrayItem = new ArrayList<>();
|
||||
|
||||
public TypeHolderDefault stringItem(String stringItem) {
|
||||
this.stringItem = stringItem;
|
||||
@@ -122,7 +122,7 @@ public class TypeHolderDefault {
|
||||
|
||||
public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
|
||||
if (this.arrayItem == null) {
|
||||
this.arrayItem = new ArrayList<Integer>();
|
||||
this.arrayItem = new ArrayList<>();
|
||||
}
|
||||
this.arrayItem.add(arrayItemItem);
|
||||
return this;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class TypeHolderExample {
|
||||
|
||||
@JsonProperty("array_item")
|
||||
@Valid
|
||||
private List<Integer> arrayItem = new ArrayList<Integer>();
|
||||
private List<Integer> arrayItem = new ArrayList<>();
|
||||
|
||||
public TypeHolderExample stringItem(String stringItem) {
|
||||
this.stringItem = stringItem;
|
||||
@@ -144,7 +144,7 @@ public class TypeHolderExample {
|
||||
|
||||
public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
|
||||
if (this.arrayItem == null) {
|
||||
this.arrayItem = new ArrayList<Integer>();
|
||||
this.arrayItem = new ArrayList<>();
|
||||
}
|
||||
this.arrayItem.add(arrayItemItem);
|
||||
return this;
|
||||
|
||||
@@ -202,7 +202,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) {
|
||||
if (this.wrappedArray == null) {
|
||||
this.wrappedArray = new ArrayList<Integer>();
|
||||
this.wrappedArray = new ArrayList<>();
|
||||
}
|
||||
this.wrappedArray.add(wrappedArrayItem);
|
||||
return this;
|
||||
@@ -305,7 +305,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addNameArrayItem(Integer nameArrayItem) {
|
||||
if (this.nameArray == null) {
|
||||
this.nameArray = new ArrayList<Integer>();
|
||||
this.nameArray = new ArrayList<>();
|
||||
}
|
||||
this.nameArray.add(nameArrayItem);
|
||||
return this;
|
||||
@@ -332,7 +332,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) {
|
||||
if (this.nameWrappedArray == null) {
|
||||
this.nameWrappedArray = new ArrayList<Integer>();
|
||||
this.nameWrappedArray = new ArrayList<>();
|
||||
}
|
||||
this.nameWrappedArray.add(nameWrappedArrayItem);
|
||||
return this;
|
||||
@@ -435,7 +435,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addPrefixArrayItem(Integer prefixArrayItem) {
|
||||
if (this.prefixArray == null) {
|
||||
this.prefixArray = new ArrayList<Integer>();
|
||||
this.prefixArray = new ArrayList<>();
|
||||
}
|
||||
this.prefixArray.add(prefixArrayItem);
|
||||
return this;
|
||||
@@ -462,7 +462,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) {
|
||||
if (this.prefixWrappedArray == null) {
|
||||
this.prefixWrappedArray = new ArrayList<Integer>();
|
||||
this.prefixWrappedArray = new ArrayList<>();
|
||||
}
|
||||
this.prefixWrappedArray.add(prefixWrappedArrayItem);
|
||||
return this;
|
||||
@@ -565,7 +565,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) {
|
||||
if (this.namespaceArray == null) {
|
||||
this.namespaceArray = new ArrayList<Integer>();
|
||||
this.namespaceArray = new ArrayList<>();
|
||||
}
|
||||
this.namespaceArray.add(namespaceArrayItem);
|
||||
return this;
|
||||
@@ -592,7 +592,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) {
|
||||
if (this.namespaceWrappedArray == null) {
|
||||
this.namespaceWrappedArray = new ArrayList<Integer>();
|
||||
this.namespaceWrappedArray = new ArrayList<>();
|
||||
}
|
||||
this.namespaceWrappedArray.add(namespaceWrappedArrayItem);
|
||||
return this;
|
||||
@@ -695,7 +695,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) {
|
||||
if (this.prefixNsArray == null) {
|
||||
this.prefixNsArray = new ArrayList<Integer>();
|
||||
this.prefixNsArray = new ArrayList<>();
|
||||
}
|
||||
this.prefixNsArray.add(prefixNsArrayItem);
|
||||
return this;
|
||||
@@ -722,7 +722,7 @@ public class XmlItem {
|
||||
|
||||
public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) {
|
||||
if (this.prefixNsWrappedArray == null) {
|
||||
this.prefixNsWrappedArray = new ArrayList<Integer>();
|
||||
this.prefixNsWrappedArray = new ArrayList<>();
|
||||
}
|
||||
this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem);
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user