[java] implement #18032 add builder pattern to java client and spring generator (#18650)

* add builder pattern to java client and spring generator

* regenerate samples

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
This commit is contained in:
William Cheng
2024-05-14 11:38:30 +08:00
committed by GitHub
parent 2f734515a1
commit 51ef8683fb
276 changed files with 12819 additions and 38 deletions

View File

@@ -38,6 +38,10 @@ public class AnimalDto {
private String color = "red";
public AnimalDto() {
super();
}
public AnimalDto className(String className) {
this.className = className;
return this;

View File

@@ -68,6 +68,10 @@ public class BigCatDto extends CatDto {
private KindEnum kind;
public BigCatDto() {
super();
}
public BigCatDto kind(KindEnum kind) {
this.kind = kind;
return this;

View File

@@ -35,6 +35,10 @@ public class CatDto extends AnimalDto {
private Boolean declawed;
public CatDto() {
super();
}
public CatDto declawed(Boolean declawed) {
this.declawed = declawed;
return this;

View File

@@ -25,6 +25,10 @@ public class CategoryDto {
private String name = "default-name";
public CategoryDto() {
super();
}
public CategoryDto id(Long id) {
this.id = id;
return this;

View File

@@ -38,6 +38,10 @@ public class ContainerDefaultValueDto {
private JsonNullable<List<String>> nullableArrayWithDefault = JsonNullable.<List<String>>undefined();
public ContainerDefaultValueDto() {
super();
}
public ContainerDefaultValueDto nullableArray(List<String> nullableArray) {
this.nullableArray = JsonNullable.of(nullableArray);
return this;

View File

@@ -28,6 +28,10 @@ public class DogDto extends AnimalDto {
private String breed;
public DogDto() {
super();
}
public DogDto breed(String breed) {
this.breed = breed;
return this;

View File

@@ -177,6 +177,10 @@ public class EnumTestDto {
private OuterEnumDto outerEnum;
public EnumTestDto() {
super();
}
public EnumTestDto enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;

View File

@@ -57,6 +57,10 @@ public class FormatTestDto {
private BigDecimal bigDecimal;
public FormatTestDto() {
super();
}
public FormatTestDto integer(Integer integer) {
this.integer = integer;
return this;

View File

@@ -29,6 +29,10 @@ public class NameDto {
private Integer _123number;
public NameDto() {
super();
}
public NameDto name(Integer name) {
this.name = name;
return this;

View File

@@ -82,6 +82,10 @@ public class PetDto {
@Deprecated
private StatusEnum status;
public PetDto() {
super();
}
public PetDto id(Long id) {
this.id = id;
return this;

View File

@@ -36,6 +36,10 @@ public class TypeHolderDefaultDto {
private List<Integer> arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
public TypeHolderDefaultDto() {
super();
}
public TypeHolderDefaultDto stringItem(String stringItem) {
this.stringItem = stringItem;
return this;

View File

@@ -38,6 +38,10 @@ public class TypeHolderExampleDto {
private List<Integer> arrayItem = new ArrayList<>();
public TypeHolderExampleDto() {
super();
}
public TypeHolderExampleDto stringItem(String stringItem) {
this.stringItem = stringItem;
return this;