
uk.gov.justice.laa.crime.common.model.meansassessment.ApiIncomeEvidence Maven / Gradle / Ivy
package uk.gov.justice.laa.crime.common.model.meansassessment;
import java.time.LocalDateTime;
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.Valid;
/**
* The Income Evidence schema
*
* Information About an Income Evidence Item
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"id",
"dateReceived",
"dateModified",
"active",
"apiEvidenceType",
"mandatory",
"applicantId",
"otherText",
"adhoc"
})
@Generated("jsonschema2pojo")
public class ApiIncomeEvidence {
/**
* The ID of the income evidence item associated with the financial assessment
*
*/
@JsonProperty("id")
@JsonPropertyDescription("The ID of the income evidence item associated with the financial assessment")
private Integer id;
/**
* The date the evidence was received
*
*/
@JsonProperty("dateReceived")
@JsonPropertyDescription("The date the evidence was received")
private LocalDateTime dateReceived;
/**
* Evidence modified Date
*
*/
@JsonProperty("dateModified")
@JsonPropertyDescription("Evidence modified Date")
private LocalDateTime dateModified;
/**
* Is the evidence active
*
*/
@JsonProperty("active")
@JsonPropertyDescription("Is the evidence active")
private String active;
/**
* Evidence type.
*
*/
@JsonProperty("apiEvidenceType")
@JsonPropertyDescription("Evidence type.")
@Valid
private ApiEvidenceType apiEvidenceType;
/**
* Indicates whether the evidence is mandatory
*
*/
@JsonProperty("mandatory")
@JsonPropertyDescription("Indicates whether the evidence is mandatory")
private String mandatory;
/**
* The ID of the person associated with the income evidence (applicant or partner)
*
*/
@JsonProperty("applicantId")
@JsonPropertyDescription("The ID of the person associated with the income evidence (applicant or partner)")
private Integer applicantId;
/**
* The evidence description (required for certain evidence types)
*
*/
@JsonProperty("otherText")
@JsonPropertyDescription("The evidence description (required for certain evidence types)")
private String otherText;
/**
* Indicates who the other adhoc evidence is associated with (applicant or partner)
*
*/
@JsonProperty("adhoc")
@JsonPropertyDescription("Indicates who the other adhoc evidence is associated with (applicant or partner)")
private String adhoc;
protected final static Object NOT_FOUND_VALUE = new Object();
/**
* No args constructor for use in serialization
*
*/
public ApiIncomeEvidence() {
}
/**
*
* @param apiEvidenceType
* @param dateReceived
* @param active
* @param otherText
* @param dateModified
* @param id
* @param applicantId
* @param adhoc
* @param mandatory
*/
public ApiIncomeEvidence(Integer id, LocalDateTime dateReceived, LocalDateTime dateModified, String active, ApiEvidenceType apiEvidenceType, String mandatory, Integer applicantId, String otherText, String adhoc) {
super();
this.id = id;
this.dateReceived = dateReceived;
this.dateModified = dateModified;
this.active = active;
this.apiEvidenceType = apiEvidenceType;
this.mandatory = mandatory;
this.applicantId = applicantId;
this.otherText = otherText;
this.adhoc = adhoc;
}
/**
* The ID of the income evidence item associated with the financial assessment
*
*/
@JsonProperty("id")
public Integer getId() {
return id;
}
/**
* The ID of the income evidence item associated with the financial assessment
*
*/
@JsonProperty("id")
public void setId(Integer id) {
this.id = id;
}
public ApiIncomeEvidence withId(Integer id) {
this.id = id;
return this;
}
/**
* The date the evidence was received
*
*/
@JsonProperty("dateReceived")
public LocalDateTime getDateReceived() {
return dateReceived;
}
/**
* The date the evidence was received
*
*/
@JsonProperty("dateReceived")
public void setDateReceived(LocalDateTime dateReceived) {
this.dateReceived = dateReceived;
}
public ApiIncomeEvidence withDateReceived(LocalDateTime dateReceived) {
this.dateReceived = dateReceived;
return this;
}
/**
* Evidence modified Date
*
*/
@JsonProperty("dateModified")
public LocalDateTime getDateModified() {
return dateModified;
}
/**
* Evidence modified Date
*
*/
@JsonProperty("dateModified")
public void setDateModified(LocalDateTime dateModified) {
this.dateModified = dateModified;
}
public ApiIncomeEvidence withDateModified(LocalDateTime dateModified) {
this.dateModified = dateModified;
return this;
}
/**
* Is the evidence active
*
*/
@JsonProperty("active")
public String getActive() {
return active;
}
/**
* Is the evidence active
*
*/
@JsonProperty("active")
public void setActive(String active) {
this.active = active;
}
public ApiIncomeEvidence withActive(String active) {
this.active = active;
return this;
}
/**
* Evidence type.
*
*/
@JsonProperty("apiEvidenceType")
public ApiEvidenceType getApiEvidenceType() {
return apiEvidenceType;
}
/**
* Evidence type.
*
*/
@JsonProperty("apiEvidenceType")
public void setApiEvidenceType(ApiEvidenceType apiEvidenceType) {
this.apiEvidenceType = apiEvidenceType;
}
public ApiIncomeEvidence withApiEvidenceType(ApiEvidenceType apiEvidenceType) {
this.apiEvidenceType = apiEvidenceType;
return this;
}
/**
* Indicates whether the evidence is mandatory
*
*/
@JsonProperty("mandatory")
public String getMandatory() {
return mandatory;
}
/**
* Indicates whether the evidence is mandatory
*
*/
@JsonProperty("mandatory")
public void setMandatory(String mandatory) {
this.mandatory = mandatory;
}
public ApiIncomeEvidence withMandatory(String mandatory) {
this.mandatory = mandatory;
return this;
}
/**
* The ID of the person associated with the income evidence (applicant or partner)
*
*/
@JsonProperty("applicantId")
public Integer getApplicantId() {
return applicantId;
}
/**
* The ID of the person associated with the income evidence (applicant or partner)
*
*/
@JsonProperty("applicantId")
public void setApplicantId(Integer applicantId) {
this.applicantId = applicantId;
}
public ApiIncomeEvidence withApplicantId(Integer applicantId) {
this.applicantId = applicantId;
return this;
}
/**
* The evidence description (required for certain evidence types)
*
*/
@JsonProperty("otherText")
public String getOtherText() {
return otherText;
}
/**
* The evidence description (required for certain evidence types)
*
*/
@JsonProperty("otherText")
public void setOtherText(String otherText) {
this.otherText = otherText;
}
public ApiIncomeEvidence withOtherText(String otherText) {
this.otherText = otherText;
return this;
}
/**
* Indicates who the other adhoc evidence is associated with (applicant or partner)
*
*/
@JsonProperty("adhoc")
public String getAdhoc() {
return adhoc;
}
/**
* Indicates who the other adhoc evidence is associated with (applicant or partner)
*
*/
@JsonProperty("adhoc")
public void setAdhoc(String adhoc) {
this.adhoc = adhoc;
}
public ApiIncomeEvidence withAdhoc(String adhoc) {
this.adhoc = adhoc;
return this;
}
protected boolean declaredProperty(String name, Object value) {
if ("id".equals(name)) {
if (value instanceof Integer) {
setId(((Integer) value));
} else {
throw new IllegalArgumentException(("property \"id\" is of type \"java.lang.Integer\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("dateReceived".equals(name)) {
if (value instanceof LocalDateTime) {
setDateReceived(((LocalDateTime) value));
} else {
throw new IllegalArgumentException(("property \"dateReceived\" is of type \"java.time.LocalDateTime\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("dateModified".equals(name)) {
if (value instanceof LocalDateTime) {
setDateModified(((LocalDateTime) value));
} else {
throw new IllegalArgumentException(("property \"dateModified\" is of type \"java.time.LocalDateTime\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("active".equals(name)) {
if (value instanceof String) {
setActive(((String) value));
} else {
throw new IllegalArgumentException(("property \"active\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("apiEvidenceType".equals(name)) {
if (value instanceof ApiEvidenceType) {
setApiEvidenceType(((ApiEvidenceType) value));
} else {
throw new IllegalArgumentException(("property \"apiEvidenceType\" is of type \"uk.gov.justice.laa.crime.common.model.meansassessment.ApiEvidenceType\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("mandatory".equals(name)) {
if (value instanceof String) {
setMandatory(((String) value));
} else {
throw new IllegalArgumentException(("property \"mandatory\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("applicantId".equals(name)) {
if (value instanceof Integer) {
setApplicantId(((Integer) value));
} else {
throw new IllegalArgumentException(("property \"applicantId\" is of type \"java.lang.Integer\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("otherText".equals(name)) {
if (value instanceof String) {
setOtherText(((String) value));
} else {
throw new IllegalArgumentException(("property \"otherText\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("adhoc".equals(name)) {
if (value instanceof String) {
setAdhoc(((String) value));
} else {
throw new IllegalArgumentException(("property \"adhoc\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
return false;
}
}
}
}
}
}
}
}
}
}
protected Object declaredPropertyOrNotFound(String name, Object notFoundValue) {
if ("id".equals(name)) {
return getId();
} else {
if ("dateReceived".equals(name)) {
return getDateReceived();
} else {
if ("dateModified".equals(name)) {
return getDateModified();
} else {
if ("active".equals(name)) {
return getActive();
} else {
if ("apiEvidenceType".equals(name)) {
return getApiEvidenceType();
} else {
if ("mandatory".equals(name)) {
return getMandatory();
} else {
if ("applicantId".equals(name)) {
return getApplicantId();
} else {
if ("otherText".equals(name)) {
return getOtherText();
} else {
if ("adhoc".equals(name)) {
return getAdhoc();
} else {
return notFoundValue;
}
}
}
}
}
}
}
}
}
}
@SuppressWarnings({
"unchecked"
})
publicT get(String name) {
Object value = declaredPropertyOrNotFound(name, ApiIncomeEvidence.NOT_FOUND_VALUE);
if (ApiIncomeEvidence.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 ApiIncomeEvidence 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(ApiIncomeEvidence.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("id");
sb.append('=');
sb.append(((this.id == null)?"":this.id));
sb.append(',');
sb.append("dateReceived");
sb.append('=');
sb.append(((this.dateReceived == null)?"":this.dateReceived));
sb.append(',');
sb.append("dateModified");
sb.append('=');
sb.append(((this.dateModified == null)?"":this.dateModified));
sb.append(',');
sb.append("active");
sb.append('=');
sb.append(((this.active == null)?"":this.active));
sb.append(',');
sb.append("apiEvidenceType");
sb.append('=');
sb.append(((this.apiEvidenceType == null)?"":this.apiEvidenceType));
sb.append(',');
sb.append("mandatory");
sb.append('=');
sb.append(((this.mandatory == null)?"":this.mandatory));
sb.append(',');
sb.append("applicantId");
sb.append('=');
sb.append(((this.applicantId == null)?"":this.applicantId));
sb.append(',');
sb.append("otherText");
sb.append('=');
sb.append(((this.otherText == null)?"":this.otherText));
sb.append(',');
sb.append("adhoc");
sb.append('=');
sb.append(((this.adhoc == null)?"":this.adhoc));
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.apiEvidenceType == null)? 0 :this.apiEvidenceType.hashCode()));
result = ((result* 31)+((this.dateReceived == null)? 0 :this.dateReceived.hashCode()));
result = ((result* 31)+((this.active == null)? 0 :this.active.hashCode()));
result = ((result* 31)+((this.otherText == null)? 0 :this.otherText.hashCode()));
result = ((result* 31)+((this.dateModified == null)? 0 :this.dateModified.hashCode()));
result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode()));
result = ((result* 31)+((this.applicantId == null)? 0 :this.applicantId.hashCode()));
result = ((result* 31)+((this.adhoc == null)? 0 :this.adhoc.hashCode()));
result = ((result* 31)+((this.mandatory == null)? 0 :this.mandatory.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof ApiIncomeEvidence) == false) {
return false;
}
ApiIncomeEvidence rhs = ((ApiIncomeEvidence) other);
return ((((((((((this.apiEvidenceType == rhs.apiEvidenceType)||((this.apiEvidenceType!= null)&&this.apiEvidenceType.equals(rhs.apiEvidenceType)))&&((this.dateReceived == rhs.dateReceived)||((this.dateReceived!= null)&&this.dateReceived.equals(rhs.dateReceived))))&&((this.active == rhs.active)||((this.active!= null)&&this.active.equals(rhs.active))))&&((this.otherText == rhs.otherText)||((this.otherText!= null)&&this.otherText.equals(rhs.otherText))))&&((this.dateModified == rhs.dateModified)||((this.dateModified!= null)&&this.dateModified.equals(rhs.dateModified))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.applicantId == rhs.applicantId)||((this.applicantId!= null)&&this.applicantId.equals(rhs.applicantId))))&&((this.adhoc == rhs.adhoc)||((this.adhoc!= null)&&this.adhoc.equals(rhs.adhoc))))&&((this.mandatory == rhs.mandatory)||((this.mandatory!= null)&&this.mandatory.equals(rhs.mandatory))));
}
}