forked from loafle/openapi-generator-original
[Java Spring] Fix copyOf inheritance using empty object instead of passed value (#19426)
* Fix copyOf inheritance using empty object instead of passed value * Generate new samples
This commit is contained in:
parent
d9cdecf3c3
commit
a84946bdb3
@ -15,7 +15,7 @@
|
||||
}
|
||||
|
||||
protected Builder copyOf({{classname}} value) { {{#parentModel}}
|
||||
super.copyOf(instance);{{/parentModel}}{{#vars}}
|
||||
super.copyOf(value);{{/parentModel}}{{#vars}}
|
||||
this.instance.{{setter}}(value.{{name}});{{/vars}}
|
||||
return this;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public class Bar extends Entity implements BarRefOrValue {
|
||||
}
|
||||
|
||||
protected Builder copyOf(Bar value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setId(value.id);
|
||||
this.instance.setBarPropA(value.barPropA);
|
||||
this.instance.setFooPropB(value.fooPropB);
|
||||
|
@ -188,7 +188,7 @@ public class BarCreate extends Entity {
|
||||
}
|
||||
|
||||
protected Builder copyOf(BarCreate value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setBarPropA(value.barPropA);
|
||||
this.instance.setFooPropB(value.fooPropB);
|
||||
this.instance.setFoo(value.foo);
|
||||
|
@ -122,7 +122,7 @@ public class BarRef extends EntityRef implements BarRefOrValue {
|
||||
}
|
||||
|
||||
protected Builder copyOf(BarRef value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class Foo extends Entity implements FooRefOrValue {
|
||||
}
|
||||
|
||||
protected Builder copyOf(Foo value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setFooPropA(value.fooPropA);
|
||||
this.instance.setFooPropB(value.fooPropB);
|
||||
return this;
|
||||
|
@ -147,7 +147,7 @@ public class FooRef extends EntityRef implements FooRefOrValue {
|
||||
}
|
||||
|
||||
protected Builder copyOf(FooRef value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setFoorefPropA(value.foorefPropA);
|
||||
return this;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ public class Pasta extends Entity {
|
||||
}
|
||||
|
||||
protected Builder copyOf(Pasta value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setVendor(value.vendor);
|
||||
return this;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class Pizza extends Entity {
|
||||
}
|
||||
|
||||
protected Builder copyOf(Pizza value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setPizzaSize(value.pizzaSize);
|
||||
return this;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class PizzaSpeziale extends Pizza {
|
||||
}
|
||||
|
||||
protected Builder copyOf(PizzaSpeziale value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setToppings(value.toppings);
|
||||
return this;
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ public class BigCat extends Cat {
|
||||
}
|
||||
|
||||
protected Builder copyOf(BigCat value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setKind(value.kind);
|
||||
return this;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class Cat extends Animal {
|
||||
}
|
||||
|
||||
protected Builder copyOf(Cat value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setDeclawed(value.declawed);
|
||||
return this;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class ChildWithNullable extends ParentWithNullable {
|
||||
}
|
||||
|
||||
protected Builder copyOf(ChildWithNullable value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setOtherProperty(value.otherProperty);
|
||||
return this;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ public class Dog extends Animal {
|
||||
}
|
||||
|
||||
protected Builder copyOf(Dog value) {
|
||||
super.copyOf(instance);
|
||||
super.copyOf(value);
|
||||
this.instance.setBreed(value.breed);
|
||||
return this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user