com.dell.cpsd.sample.service.api.Error Maven / Gradle / Ivy
package com.dell.cpsd.sample.service.api;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
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 org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"code",
"message"
})
public class Error implements Serializable
{
/**
* Error code
*
* The error code provided by the service.
* (Required)
*
*/
@JsonProperty("code")
@JsonPropertyDescription("The error code provided by the service.")
private String code;
/**
* Error message
*
* The error message provided by the service.
* (Required)
*
*/
@JsonProperty("message")
@JsonPropertyDescription("The error message provided by the service.")
private String message;
@JsonIgnore
private Map additionalProperties = new HashMap();
private final static long serialVersionUID = 3035298597372849920L;
/**
* No args constructor for use in serialization
*
*/
public Error() {
}
/**
*
* @param code
* @param message
*/
public Error(String code, String message) {
super();
this.code = code;
this.message = message;
}
/**
* Error code
*
* The error code provided by the service.
* (Required)
*
*/
@JsonProperty("code")
public String getCode() {
return code;
}
/**
* Error code
*
* The error code provided by the service.
* (Required)
*
*/
@JsonProperty("code")
public void setCode(String code) {
this.code = code;
}
/**
* Error message
*
* The error message provided by the service.
* (Required)
*
*/
@JsonProperty("message")
public String getMessage() {
return message;
}
/**
* Error message
*
* The error message provided by the service.
* (Required)
*
*/
@JsonProperty("message")
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(code).append(message).append(additionalProperties).toHashCode();
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Error) == false) {
return false;
}
Error rhs = ((Error) other);
return new EqualsBuilder().append(code, rhs.code).append(message, rhs.message).append(additionalProperties, rhs.additionalProperties).isEquals();
}
}