
uk.gov.justice.laa.crime.common.model.hardship.ApiHardshipDetail Maven / Gradle / Ivy
package uk.gov.justice.laa.crime.common.model.hardship;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
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;
import jakarta.validation.constraints.NotNull;
import uk.gov.justice.laa.crime.enums.Frequency;
import uk.gov.justice.laa.crime.enums.HardshipReviewDetailCode;
import uk.gov.justice.laa.crime.enums.HardshipReviewDetailReason;
import uk.gov.justice.laa.crime.enums.HardshipReviewDetailType;
/**
* Hardship Review Details Schema
*
* Data contract for Hardship Review Detail Items in the Court Data API
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"id",
"frequency",
"amount",
"dateDue",
"accepted",
"otherDescription",
"reasonNote",
"detailType",
"detailCode",
"detailReason",
"userCreated",
"active"
})
@Generated("jsonschema2pojo")
public class ApiHardshipDetail {
/**
* Hardship Review Detail ID
*
*/
@JsonProperty("id")
@JsonPropertyDescription("Hardship Review Detail ID")
private Integer id;
/**
* The Frequency of Applicant
* (Required)
*
*/
@JsonProperty("frequency")
@JsonPropertyDescription("The Frequency of Applicant")
@Valid
@NotNull
private Frequency frequency;
/**
* The amount under consideration
* (Required)
*
*/
@JsonProperty("amount")
@JsonPropertyDescription("The amount under consideration")
@NotNull
private BigDecimal amount;
/**
* The date the Hardship Review Detail item is due
*
*/
@JsonProperty("dateDue")
@JsonPropertyDescription("The date the Hardship Review Detail item is due")
private LocalDateTime dateDue;
/**
* Indicates whether the detail item has been accepted
*
*/
@JsonProperty("accepted")
@JsonPropertyDescription("Indicates whether the detail item has been accepted")
private String accepted;
/**
* The alternative description
*
*/
@JsonProperty("otherDescription")
@JsonPropertyDescription("The alternative description")
private String otherDescription;
/**
* The reason note
*
*/
@JsonProperty("reasonNote")
@JsonPropertyDescription("The reason note")
private String reasonNote;
/**
* Hardship review detail type
* (Required)
*
*/
@JsonProperty("detailType")
@JsonPropertyDescription("Hardship review detail type")
@Valid
@NotNull
private HardshipReviewDetailType detailType;
/**
* The Hardship Review Detail code
*
*/
@JsonProperty("detailCode")
@JsonPropertyDescription("The Hardship Review Detail code")
@Valid
private HardshipReviewDetailCode detailCode;
/**
* The Hardship Review Detail reasons code
*
*/
@JsonProperty("detailReason")
@JsonPropertyDescription("The Hardship Review Detail reasons code")
@Valid
private HardshipReviewDetailReason detailReason;
/**
* ID of the user creating the progress item
*
*/
@JsonProperty("userCreated")
@JsonPropertyDescription("ID of the user creating the progress item")
private String userCreated;
/**
* Indicates if the detail is currently active
*
*/
@JsonProperty("active")
@JsonPropertyDescription("Indicates if the detail is currently active")
private String active;
@JsonIgnore
@Valid
private Map additionalProperties = new LinkedHashMap();
protected final static Object NOT_FOUND_VALUE = new Object();
/**
* No args constructor for use in serialization
*
*/
public ApiHardshipDetail() {
}
/**
*
* @param dateDue
* @param detailType
* @param amount
* @param accepted
* @param reasonNote
* @param active
* @param id
* @param otherDescription
* @param detailCode
* @param userCreated
* @param detailReason
* @param frequency
*/
public ApiHardshipDetail(Integer id, Frequency frequency, BigDecimal amount, LocalDateTime dateDue, String accepted, String otherDescription, String reasonNote, HardshipReviewDetailType detailType, HardshipReviewDetailCode detailCode, HardshipReviewDetailReason detailReason, String userCreated, String active) {
super();
this.id = id;
this.frequency = frequency;
this.amount = amount;
this.dateDue = dateDue;
this.accepted = accepted;
this.otherDescription = otherDescription;
this.reasonNote = reasonNote;
this.detailType = detailType;
this.detailCode = detailCode;
this.detailReason = detailReason;
this.userCreated = userCreated;
this.active = active;
}
/**
* Hardship Review Detail ID
*
*/
@JsonProperty("id")
public Integer getId() {
return id;
}
/**
* Hardship Review Detail ID
*
*/
@JsonProperty("id")
public void setId(Integer id) {
this.id = id;
}
public ApiHardshipDetail withId(Integer id) {
this.id = id;
return this;
}
/**
* The Frequency of Applicant
* (Required)
*
*/
@JsonProperty("frequency")
public Frequency getFrequency() {
return frequency;
}
/**
* The Frequency of Applicant
* (Required)
*
*/
@JsonProperty("frequency")
public void setFrequency(Frequency frequency) {
this.frequency = frequency;
}
public ApiHardshipDetail withFrequency(Frequency frequency) {
this.frequency = frequency;
return this;
}
/**
* The amount under consideration
* (Required)
*
*/
@JsonProperty("amount")
public BigDecimal getAmount() {
return amount;
}
/**
* The amount under consideration
* (Required)
*
*/
@JsonProperty("amount")
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public ApiHardshipDetail withAmount(BigDecimal amount) {
this.amount = amount;
return this;
}
/**
* The date the Hardship Review Detail item is due
*
*/
@JsonProperty("dateDue")
public LocalDateTime getDateDue() {
return dateDue;
}
/**
* The date the Hardship Review Detail item is due
*
*/
@JsonProperty("dateDue")
public void setDateDue(LocalDateTime dateDue) {
this.dateDue = dateDue;
}
public ApiHardshipDetail withDateDue(LocalDateTime dateDue) {
this.dateDue = dateDue;
return this;
}
/**
* Indicates whether the detail item has been accepted
*
*/
@JsonProperty("accepted")
public String getAccepted() {
return accepted;
}
/**
* Indicates whether the detail item has been accepted
*
*/
@JsonProperty("accepted")
public void setAccepted(String accepted) {
this.accepted = accepted;
}
public ApiHardshipDetail withAccepted(String accepted) {
this.accepted = accepted;
return this;
}
/**
* The alternative description
*
*/
@JsonProperty("otherDescription")
public String getOtherDescription() {
return otherDescription;
}
/**
* The alternative description
*
*/
@JsonProperty("otherDescription")
public void setOtherDescription(String otherDescription) {
this.otherDescription = otherDescription;
}
public ApiHardshipDetail withOtherDescription(String otherDescription) {
this.otherDescription = otherDescription;
return this;
}
/**
* The reason note
*
*/
@JsonProperty("reasonNote")
public String getReasonNote() {
return reasonNote;
}
/**
* The reason note
*
*/
@JsonProperty("reasonNote")
public void setReasonNote(String reasonNote) {
this.reasonNote = reasonNote;
}
public ApiHardshipDetail withReasonNote(String reasonNote) {
this.reasonNote = reasonNote;
return this;
}
/**
* Hardship review detail type
* (Required)
*
*/
@JsonProperty("detailType")
public HardshipReviewDetailType getDetailType() {
return detailType;
}
/**
* Hardship review detail type
* (Required)
*
*/
@JsonProperty("detailType")
public void setDetailType(HardshipReviewDetailType detailType) {
this.detailType = detailType;
}
public ApiHardshipDetail withDetailType(HardshipReviewDetailType detailType) {
this.detailType = detailType;
return this;
}
/**
* The Hardship Review Detail code
*
*/
@JsonProperty("detailCode")
public HardshipReviewDetailCode getDetailCode() {
return detailCode;
}
/**
* The Hardship Review Detail code
*
*/
@JsonProperty("detailCode")
public void setDetailCode(HardshipReviewDetailCode detailCode) {
this.detailCode = detailCode;
}
public ApiHardshipDetail withDetailCode(HardshipReviewDetailCode detailCode) {
this.detailCode = detailCode;
return this;
}
/**
* The Hardship Review Detail reasons code
*
*/
@JsonProperty("detailReason")
public HardshipReviewDetailReason getDetailReason() {
return detailReason;
}
/**
* The Hardship Review Detail reasons code
*
*/
@JsonProperty("detailReason")
public void setDetailReason(HardshipReviewDetailReason detailReason) {
this.detailReason = detailReason;
}
public ApiHardshipDetail withDetailReason(HardshipReviewDetailReason detailReason) {
this.detailReason = detailReason;
return this;
}
/**
* ID of the user creating the progress item
*
*/
@JsonProperty("userCreated")
public String getUserCreated() {
return userCreated;
}
/**
* ID of the user creating the progress item
*
*/
@JsonProperty("userCreated")
public void setUserCreated(String userCreated) {
this.userCreated = userCreated;
}
public ApiHardshipDetail withUserCreated(String userCreated) {
this.userCreated = userCreated;
return this;
}
/**
* Indicates if the detail is currently active
*
*/
@JsonProperty("active")
public String getActive() {
return active;
}
/**
* Indicates if the detail is currently active
*
*/
@JsonProperty("active")
public void setActive(String active) {
this.active = active;
}
public ApiHardshipDetail withActive(String active) {
this.active = active;
return this;
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public ApiHardshipDetail withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
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 ("frequency".equals(name)) {
if (value instanceof Frequency) {
setFrequency(((Frequency) value));
} else {
throw new IllegalArgumentException(("property \"frequency\" is of type \"uk.gov.justice.laa.crime.enums.Frequency\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("amount".equals(name)) {
if (value instanceof BigDecimal) {
setAmount(((BigDecimal) value));
} else {
throw new IllegalArgumentException(("property \"amount\" is of type \"java.math.BigDecimal\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("dateDue".equals(name)) {
if (value instanceof LocalDateTime) {
setDateDue(((LocalDateTime) value));
} else {
throw new IllegalArgumentException(("property \"dateDue\" is of type \"java.time.LocalDateTime\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("accepted".equals(name)) {
if (value instanceof String) {
setAccepted(((String) value));
} else {
throw new IllegalArgumentException(("property \"accepted\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("otherDescription".equals(name)) {
if (value instanceof String) {
setOtherDescription(((String) value));
} else {
throw new IllegalArgumentException(("property \"otherDescription\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("reasonNote".equals(name)) {
if (value instanceof String) {
setReasonNote(((String) value));
} else {
throw new IllegalArgumentException(("property \"reasonNote\" is of type \"java.lang.String\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("detailType".equals(name)) {
if (value instanceof HardshipReviewDetailType) {
setDetailType(((HardshipReviewDetailType) value));
} else {
throw new IllegalArgumentException(("property \"detailType\" is of type \"uk.gov.justice.laa.crime.enums.HardshipReviewDetailType\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("detailCode".equals(name)) {
if (value instanceof HardshipReviewDetailCode) {
setDetailCode(((HardshipReviewDetailCode) value));
} else {
throw new IllegalArgumentException(("property \"detailCode\" is of type \"uk.gov.justice.laa.crime.enums.HardshipReviewDetailCode\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("detailReason".equals(name)) {
if (value instanceof HardshipReviewDetailReason) {
setDetailReason(((HardshipReviewDetailReason) value));
} else {
throw new IllegalArgumentException(("property \"detailReason\" is of type \"uk.gov.justice.laa.crime.enums.HardshipReviewDetailReason\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("userCreated".equals(name)) {
if (value instanceof String) {
setUserCreated(((String) value));
} else {
throw new IllegalArgumentException(("property \"userCreated\" is of type \"java.lang.String\", 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 {
return false;
}
}
}
}
}
}
}
}
}
}
}
}
}
protected Object declaredPropertyOrNotFound(String name, Object notFoundValue) {
if ("id".equals(name)) {
return getId();
} else {
if ("frequency".equals(name)) {
return getFrequency();
} else {
if ("amount".equals(name)) {
return getAmount();
} else {
if ("dateDue".equals(name)) {
return getDateDue();
} else {
if ("accepted".equals(name)) {
return getAccepted();
} else {
if ("otherDescription".equals(name)) {
return getOtherDescription();
} else {
if ("reasonNote".equals(name)) {
return getReasonNote();
} else {
if ("detailType".equals(name)) {
return getDetailType();
} else {
if ("detailCode".equals(name)) {
return getDetailCode();
} else {
if ("detailReason".equals(name)) {
return getDetailReason();
} else {
if ("userCreated".equals(name)) {
return getUserCreated();
} else {
if ("active".equals(name)) {
return getActive();
} else {
return notFoundValue;
}
}
}
}
}
}
}
}
}
}
}
}
}
@SuppressWarnings({
"unchecked"
})
publicT get(String name) {
Object value = declaredPropertyOrNotFound(name, ApiHardshipDetail.NOT_FOUND_VALUE);
if (ApiHardshipDetail.NOT_FOUND_VALUE!= value) {
return ((T) value);
} else {
return ((T) getAdditionalProperties().get(name));
}
}
public void set(String name, Object value) {
if (!declaredProperty(name, value)) {
getAdditionalProperties().put(name, ((Object) value));
}
}
public ApiHardshipDetail with(String name, Object value) {
if (!declaredProperty(name, value)) {
getAdditionalProperties().put(name, ((Object) value));
}
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(ApiHardshipDetail.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("frequency");
sb.append('=');
sb.append(((this.frequency == null)?"":this.frequency));
sb.append(',');
sb.append("amount");
sb.append('=');
sb.append(((this.amount == null)?"":this.amount));
sb.append(',');
sb.append("dateDue");
sb.append('=');
sb.append(((this.dateDue == null)?"":this.dateDue));
sb.append(',');
sb.append("accepted");
sb.append('=');
sb.append(((this.accepted == null)?"":this.accepted));
sb.append(',');
sb.append("otherDescription");
sb.append('=');
sb.append(((this.otherDescription == null)?"":this.otherDescription));
sb.append(',');
sb.append("reasonNote");
sb.append('=');
sb.append(((this.reasonNote == null)?"":this.reasonNote));
sb.append(',');
sb.append("detailType");
sb.append('=');
sb.append(((this.detailType == null)?"":this.detailType));
sb.append(',');
sb.append("detailCode");
sb.append('=');
sb.append(((this.detailCode == null)?"":this.detailCode));
sb.append(',');
sb.append("detailReason");
sb.append('=');
sb.append(((this.detailReason == null)?"":this.detailReason));
sb.append(',');
sb.append("userCreated");
sb.append('=');
sb.append(((this.userCreated == null)?"":this.userCreated));
sb.append(',');
sb.append("active");
sb.append('=');
sb.append(((this.active == null)?"":this.active));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"":this.additionalProperties));
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.dateDue == null)? 0 :this.dateDue.hashCode()));
result = ((result* 31)+((this.amount == null)? 0 :this.amount.hashCode()));
result = ((result* 31)+((this.accepted == null)? 0 :this.accepted.hashCode()));
result = ((result* 31)+((this.active == null)? 0 :this.active.hashCode()));
result = ((result* 31)+((this.detailCode == null)? 0 :this.detailCode.hashCode()));
result = ((result* 31)+((this.userCreated == null)? 0 :this.userCreated.hashCode()));
result = ((result* 31)+((this.detailReason == null)? 0 :this.detailReason.hashCode()));
result = ((result* 31)+((this.frequency == null)? 0 :this.frequency.hashCode()));
result = ((result* 31)+((this.detailType == null)? 0 :this.detailType.hashCode()));
result = ((result* 31)+((this.reasonNote == null)? 0 :this.reasonNote.hashCode()));
result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.otherDescription == null)? 0 :this.otherDescription.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof ApiHardshipDetail) == false) {
return false;
}
ApiHardshipDetail rhs = ((ApiHardshipDetail) other);
return ((((((((((((((this.dateDue == rhs.dateDue)||((this.dateDue!= null)&&this.dateDue.equals(rhs.dateDue)))&&((this.amount == rhs.amount)||((this.amount!= null)&&this.amount.equals(rhs.amount))))&&((this.accepted == rhs.accepted)||((this.accepted!= null)&&this.accepted.equals(rhs.accepted))))&&((this.active == rhs.active)||((this.active!= null)&&this.active.equals(rhs.active))))&&((this.detailCode == rhs.detailCode)||((this.detailCode!= null)&&this.detailCode.equals(rhs.detailCode))))&&((this.userCreated == rhs.userCreated)||((this.userCreated!= null)&&this.userCreated.equals(rhs.userCreated))))&&((this.detailReason == rhs.detailReason)||((this.detailReason!= null)&&this.detailReason.equals(rhs.detailReason))))&&((this.frequency == rhs.frequency)||((this.frequency!= null)&&this.frequency.equals(rhs.frequency))))&&((this.detailType == rhs.detailType)||((this.detailType!= null)&&this.detailType.equals(rhs.detailType))))&&((this.reasonNote == rhs.reasonNote)||((this.reasonNote!= null)&&this.reasonNote.equals(rhs.reasonNote))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.otherDescription == rhs.otherDescription)||((this.otherDescription!= null)&&this.otherDescription.equals(rhs.otherDescription))));
}
}