
uk.gov.justice.laa.crime.common.model.hardship.ApiCalculateHardshipByDetailRequest Maven / Gradle / Ivy
package uk.gov.justice.laa.crime.common.model.hardship;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.constraints.NotNull;
/**
* Calculate Hardship By Detail Request
*
* Data contract for Calculate Hardship By Detail Request
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"repId",
"detailType"
})
@Generated("jsonschema2pojo")
public class ApiCalculateHardshipByDetailRequest {
/**
* MAAT / Rep Id
* (Required)
*
*/
@JsonProperty("repId")
@JsonPropertyDescription("MAAT / Rep Id")
@NotNull
private Integer repId;
/**
* Hardship Detail Type
* (Required)
*
*/
@JsonProperty("detailType")
@JsonPropertyDescription("Hardship Detail Type")
@NotNull
private String detailType;
protected final static Object NOT_FOUND_VALUE = new Object();
/**
* No args constructor for use in serialization
*
*/
public ApiCalculateHardshipByDetailRequest() {
}
/**
*
* @param detailType
* @param repId
*/
public ApiCalculateHardshipByDetailRequest(Integer repId, String detailType) {
super();
this.repId = repId;
this.detailType = detailType;
}
/**
* MAAT / Rep Id
* (Required)
*
*/
@JsonProperty("repId")
public Integer getRepId() {
return repId;
}
/**
* MAAT / Rep Id
* (Required)
*
*/
@JsonProperty("repId")
public void setRepId(Integer repId) {
this.repId = repId;
}
public ApiCalculateHardshipByDetailRequest withRepId(Integer repId) {
this.repId = repId;
return this;
}
/**
* Hardship Detail Type
* (Required)
*
*/
@JsonProperty("detailType")
public String getDetailType() {
return detailType;
}
/**
* Hardship Detail Type
* (Required)
*
*/
@JsonProperty("detailType")
public void setDetailType(String detailType) {
this.detailType = detailType;
}
public ApiCalculateHardshipByDetailRequest withDetailType(String detailType) {
this.detailType = detailType;
return this;
}
protected boolean declaredProperty(String name, Object value) {
if ("repId".equals(name)) {
if (value instanceof Integer) {
setRepId(((Integer) value));
} else {
throw new IllegalArgumentException(("property \"repId\" is of type \"java.lang.Integer\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("detailType".equals(name)) {
if (value instanceof String) {
setDetailType(((String) value));
} else {
throw new IllegalArgumentException(("property \"detailType\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
return false;
}
}
}
protected Object declaredPropertyOrNotFound(String name, Object notFoundValue) {
if ("repId".equals(name)) {
return getRepId();
} else {
if ("detailType".equals(name)) {
return getDetailType();
} else {
return notFoundValue;
}
}
}
@SuppressWarnings({
"unchecked"
})
publicT get(String name) {
Object value = declaredPropertyOrNotFound(name, ApiCalculateHardshipByDetailRequest.NOT_FOUND_VALUE);
if (ApiCalculateHardshipByDetailRequest.NOT_FOUND_VALUE!= value) {
return ((T) value);
} else {
throw new IllegalArgumentException((("property \""+ name)+"\" is not defined"));
}
}
public void set(String name, Object value) {
if (!declaredProperty(name, value)) {
throw new IllegalArgumentException((("property \""+ name)+"\" is not defined"));
}
}
public ApiCalculateHardshipByDetailRequest with(String name, Object value) {
if (!declaredProperty(name, value)) {
throw new IllegalArgumentException((("property \""+ name)+"\" is not defined"));
}
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(ApiCalculateHardshipByDetailRequest.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("repId");
sb.append('=');
sb.append(((this.repId == null)?"":this.repId));
sb.append(',');
sb.append("detailType");
sb.append('=');
sb.append(((this.detailType == null)?"":this.detailType));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.detailType == null)? 0 :this.detailType.hashCode()));
result = ((result* 31)+((this.repId == null)? 0 :this.repId.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof ApiCalculateHardshipByDetailRequest) == false) {
return false;
}
ApiCalculateHardshipByDetailRequest rhs = ((ApiCalculateHardshipByDetailRequest) other);
return (((this.detailType == rhs.detailType)||((this.detailType!= null)&&this.detailType.equals(rhs.detailType)))&&((this.repId == rhs.repId)||((this.repId!= null)&&this.repId.equals(rhs.repId))));
}
}