
uk.gov.justice.laa.crime.common.model.contribution.ApiAssessment Maven / Gradle / Ivy
package uk.gov.justice.laa.crime.common.model.contribution;
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;
import jakarta.validation.constraints.NotNull;
import uk.gov.justice.laa.crime.enums.AssessmentResult;
import uk.gov.justice.laa.crime.enums.CurrentStatus;
import uk.gov.justice.laa.crime.enums.NewWorkReason;
import uk.gov.justice.laa.crime.enums.contribution.AssessmentType;
/**
* Assessment
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"assessmentType",
"status",
"result",
"assessmentDate",
"newWorkReason"
})
@Generated("jsonschema2pojo")
public class ApiAssessment {
/**
* The type of assessment
* (Required)
*
*/
@JsonProperty("assessmentType")
@JsonPropertyDescription("The type of assessment")
@Valid
@NotNull
private AssessmentType assessmentType;
/**
* The assessment status
* (Required)
*
*/
@JsonProperty("status")
@JsonPropertyDescription("The assessment status")
@Valid
@NotNull
private CurrentStatus status;
/**
* The assessment result
* (Required)
*
*/
@JsonProperty("result")
@JsonPropertyDescription("The assessment result")
@Valid
@NotNull
private AssessmentResult result;
/**
* Assessment Date
*
*/
@JsonProperty("assessmentDate")
@JsonPropertyDescription("Assessment Date")
private LocalDateTime assessmentDate;
/**
* New Work Reason
*
*/
@JsonProperty("newWorkReason")
@JsonPropertyDescription("New Work Reason")
private NewWorkReason newWorkReason;
protected final static Object NOT_FOUND_VALUE = new Object();
/**
* No args constructor for use in serialization
*
*/
public ApiAssessment() {
}
/**
*
* @param result
* @param assessmentType
* @param assessmentDate
* @param newWorkReason
* @param status
*/
public ApiAssessment(AssessmentType assessmentType, CurrentStatus status, AssessmentResult result, LocalDateTime assessmentDate, NewWorkReason newWorkReason) {
super();
this.assessmentType = assessmentType;
this.status = status;
this.result = result;
this.assessmentDate = assessmentDate;
this.newWorkReason = newWorkReason;
}
/**
* The type of assessment
* (Required)
*
*/
@JsonProperty("assessmentType")
public AssessmentType getAssessmentType() {
return assessmentType;
}
/**
* The type of assessment
* (Required)
*
*/
@JsonProperty("assessmentType")
public void setAssessmentType(AssessmentType assessmentType) {
this.assessmentType = assessmentType;
}
public ApiAssessment withAssessmentType(AssessmentType assessmentType) {
this.assessmentType = assessmentType;
return this;
}
/**
* The assessment status
* (Required)
*
*/
@JsonProperty("status")
public CurrentStatus getStatus() {
return status;
}
/**
* The assessment status
* (Required)
*
*/
@JsonProperty("status")
public void setStatus(CurrentStatus status) {
this.status = status;
}
public ApiAssessment withStatus(CurrentStatus status) {
this.status = status;
return this;
}
/**
* The assessment result
* (Required)
*
*/
@JsonProperty("result")
public AssessmentResult getResult() {
return result;
}
/**
* The assessment result
* (Required)
*
*/
@JsonProperty("result")
public void setResult(AssessmentResult result) {
this.result = result;
}
public ApiAssessment withResult(AssessmentResult result) {
this.result = result;
return this;
}
/**
* Assessment Date
*
*/
@JsonProperty("assessmentDate")
public LocalDateTime getAssessmentDate() {
return assessmentDate;
}
/**
* Assessment Date
*
*/
@JsonProperty("assessmentDate")
public void setAssessmentDate(LocalDateTime assessmentDate) {
this.assessmentDate = assessmentDate;
}
public ApiAssessment withAssessmentDate(LocalDateTime assessmentDate) {
this.assessmentDate = assessmentDate;
return this;
}
/**
* New Work Reason
*
*/
@JsonProperty("newWorkReason")
public NewWorkReason getNewWorkReason() {
return newWorkReason;
}
/**
* New Work Reason
*
*/
@JsonProperty("newWorkReason")
public void setNewWorkReason(NewWorkReason newWorkReason) {
this.newWorkReason = newWorkReason;
}
public ApiAssessment withNewWorkReason(NewWorkReason newWorkReason) {
this.newWorkReason = newWorkReason;
return this;
}
protected boolean declaredProperty(String name, Object value) {
if ("assessmentType".equals(name)) {
if (value instanceof AssessmentType) {
setAssessmentType(((AssessmentType) value));
} else {
throw new IllegalArgumentException(("property \"assessmentType\" is of type \"uk.gov.justice.laa.crime.enums.contribution.AssessmentType\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("status".equals(name)) {
if (value instanceof CurrentStatus) {
setStatus(((CurrentStatus) value));
} else {
throw new IllegalArgumentException(("property \"status\" is of type \"uk.gov.justice.laa.crime.enums.CurrentStatus\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("result".equals(name)) {
if (value instanceof AssessmentResult) {
setResult(((AssessmentResult) value));
} else {
throw new IllegalArgumentException(("property \"result\" is of type \"uk.gov.justice.laa.crime.enums.AssessmentResult\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("assessmentDate".equals(name)) {
if (value instanceof LocalDateTime) {
setAssessmentDate(((LocalDateTime) value));
} else {
throw new IllegalArgumentException(("property \"assessmentDate\" is of type \"java.time.LocalDateTime\", but got "+ value.getClass().toString()));
}
return true;
} else {
if ("newWorkReason".equals(name)) {
if (value instanceof NewWorkReason) {
setNewWorkReason(((NewWorkReason) value));
} else {
throw new IllegalArgumentException(("property \"newWorkReason\" is of type \"uk.gov.justice.laa.crime.enums.NewWorkReason\", but got "+ value.getClass().toString()));
}
return true;
} else {
return false;
}
}
}
}
}
}
protected Object declaredPropertyOrNotFound(String name, Object notFoundValue) {
if ("assessmentType".equals(name)) {
return getAssessmentType();
} else {
if ("status".equals(name)) {
return getStatus();
} else {
if ("result".equals(name)) {
return getResult();
} else {
if ("assessmentDate".equals(name)) {
return getAssessmentDate();
} else {
if ("newWorkReason".equals(name)) {
return getNewWorkReason();
} else {
return notFoundValue;
}
}
}
}
}
}
@SuppressWarnings({
"unchecked"
})
publicT get(String name) {
Object value = declaredPropertyOrNotFound(name, ApiAssessment.NOT_FOUND_VALUE);
if (ApiAssessment.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 ApiAssessment 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(ApiAssessment.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("assessmentType");
sb.append('=');
sb.append(((this.assessmentType == null)?"":this.assessmentType));
sb.append(',');
sb.append("status");
sb.append('=');
sb.append(((this.status == null)?"":this.status));
sb.append(',');
sb.append("result");
sb.append('=');
sb.append(((this.result == null)?"":this.result));
sb.append(',');
sb.append("assessmentDate");
sb.append('=');
sb.append(((this.assessmentDate == null)?"":this.assessmentDate));
sb.append(',');
sb.append("newWorkReason");
sb.append('=');
sb.append(((this.newWorkReason == null)?"":this.newWorkReason));
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.result == null)? 0 :this.result.hashCode()));
result = ((result* 31)+((this.assessmentType == null)? 0 :this.assessmentType.hashCode()));
result = ((result* 31)+((this.assessmentDate == null)? 0 :this.assessmentDate.hashCode()));
result = ((result* 31)+((this.newWorkReason == null)? 0 :this.newWorkReason.hashCode()));
result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof ApiAssessment) == false) {
return false;
}
ApiAssessment rhs = ((ApiAssessment) other);
return ((((((this.result == rhs.result)||((this.result!= null)&&this.result.equals(rhs.result)))&&((this.assessmentType == rhs.assessmentType)||((this.assessmentType!= null)&&this.assessmentType.equals(rhs.assessmentType))))&&((this.assessmentDate == rhs.assessmentDate)||((this.assessmentDate!= null)&&this.assessmentDate.equals(rhs.assessmentDate))))&&((this.newWorkReason == rhs.newWorkReason)||((this.newWorkReason!= null)&&this.newWorkReason.equals(rhs.newWorkReason))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy