Make entities immutable and create proper update methods that state by signature what can be updated. (#342)
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -41,7 +41,7 @@ public class MgmtDistributionSetRequestBodyPost extends MgmtDistributionSetReque
|
||||
private List<MgmtSoftwareModuleAssigment> modules;
|
||||
|
||||
@JsonProperty
|
||||
private boolean requiredMigrationStep;
|
||||
private Boolean requiredMigrationStep;
|
||||
|
||||
@JsonProperty
|
||||
private String type;
|
||||
@@ -105,7 +105,7 @@ public class MgmtDistributionSetRequestBodyPost extends MgmtDistributionSetReque
|
||||
/**
|
||||
* @return the requiredMigrationStep
|
||||
*/
|
||||
public boolean isRequiredMigrationStep() {
|
||||
public Boolean isRequiredMigrationStep() {
|
||||
return requiredMigrationStep;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class MgmtDistributionSetRequestBodyPost extends MgmtDistributionSetReque
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public MgmtDistributionSetRequestBodyPost setRequiredMigrationStep(final boolean requiredMigrationStep) {
|
||||
public MgmtDistributionSetRequestBodyPost setRequiredMigrationStep(final Boolean requiredMigrationStep) {
|
||||
this.requiredMigrationStep = requiredMigrationStep;
|
||||
|
||||
return this;
|
||||
|
||||
@@ -18,14 +18,11 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
* Request Body for DistributionSetType POST.
|
||||
*
|
||||
*/
|
||||
public class MgmtDistributionSetTypeRequestBodyPost {
|
||||
public class MgmtDistributionSetTypeRequestBodyPost extends MgmtDistributionSetTypeRequestBodyPut {
|
||||
|
||||
@JsonProperty(required = true)
|
||||
private String name;
|
||||
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@JsonProperty
|
||||
private String key;
|
||||
|
||||
@@ -35,6 +32,18 @@ public class MgmtDistributionSetTypeRequestBodyPost {
|
||||
@JsonProperty
|
||||
private List<MgmtSoftwareModuleTypeAssigment> optionalmodules;
|
||||
|
||||
@Override
|
||||
public MgmtDistributionSetTypeRequestBodyPost setDescription(final String description) {
|
||||
super.setDescription(description);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MgmtDistributionSetTypeRequestBodyPost setColour(final String colour) {
|
||||
super.setColour(colour);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
@@ -53,24 +62,6 @@ public class MgmtDistributionSetTypeRequestBodyPost {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public MgmtDistributionSetTypeRequestBodyPost setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the key
|
||||
*/
|
||||
|
||||
@@ -19,22 +19,25 @@ public class MgmtDistributionSetTypeRequestBodyPut {
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* @return the description
|
||||
*/
|
||||
@JsonProperty
|
||||
private String colour;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public MgmtDistributionSetTypeRequestBodyPut setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getColour() {
|
||||
return colour;
|
||||
}
|
||||
|
||||
public MgmtDistributionSetTypeRequestBodyPut setColour(final String colour) {
|
||||
this.colour = colour;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,20 +14,29 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
* Request Body for SoftwareModuleType POST.
|
||||
*
|
||||
*/
|
||||
public class MgmtSoftwareModuleTypeRequestBodyPost {
|
||||
public class MgmtSoftwareModuleTypeRequestBodyPost extends MgmtSoftwareModuleTypeRequestBodyPut {
|
||||
|
||||
@JsonProperty(required = true)
|
||||
private String name;
|
||||
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@JsonProperty
|
||||
private String key;
|
||||
|
||||
@JsonProperty
|
||||
private int maxAssignments;
|
||||
|
||||
@Override
|
||||
public MgmtSoftwareModuleTypeRequestBodyPost setDescription(final String description) {
|
||||
super.setDescription(description);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MgmtSoftwareModuleTypeRequestBodyPost setColour(final String colour) {
|
||||
super.setColour(colour);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
@@ -46,24 +55,6 @@ public class MgmtSoftwareModuleTypeRequestBodyPost {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public MgmtSoftwareModuleTypeRequestBodyPost setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the key
|
||||
*/
|
||||
|
||||
@@ -19,22 +19,25 @@ public class MgmtSoftwareModuleTypeRequestBodyPut {
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* @return the description
|
||||
*/
|
||||
@JsonProperty
|
||||
private String colour;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public MgmtSoftwareModuleTypeRequestBodyPut setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getColour() {
|
||||
return colour;
|
||||
}
|
||||
|
||||
public MgmtSoftwareModuleTypeRequestBodyPut setColour(final String colour) {
|
||||
this.colour = colour;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user