com.dell.cpsd.identity.service.api.IdentityServiceError Maven / Gradle / Ivy
Show all versions of identity-service-api Show documentation
package com.dell.cpsd.identity.service.api;
import java.util.Date;
import com.dell.cpsd.common.rabbitmq.annotation.Message;
import com.dell.cpsd.common.rabbitmq.annotation.stereotypes.MessageError;
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;
/**
* The message sent when there is an identity service error.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@Message(value = "dell.cpsd.core.identity.service.error", version = "1.0")
@MessageError
@JsonPropertyOrder({
"timestamp",
"correlationId",
"errorCode",
"errorMessage"
})
public class IdentityServiceError {
/**
* Message timestamp
*
* The creation time of the message.
* (Required)
*
*/
@JsonProperty("timestamp")
@JsonPropertyDescription("")
private Date timestamp;
/**
* Correlation identifier
*
* The correlation identifier of the message.
* (Required)
*
*/
@JsonProperty("correlationId")
@JsonPropertyDescription("")
private String correlationId;
/**
* Error code
*
* The error code provided by the service.
* (Required)
*
*/
@JsonProperty("errorCode")
@JsonPropertyDescription("")
private String errorCode;
/**
* Error message
*
* The error details provided by the service.
* (Required)
*
*/
@JsonProperty("errorMessage")
@JsonPropertyDescription("")
private String errorMessage;
/**
* No args constructor for use in serialization
*
*/
public IdentityServiceError() {
}
/**
*
* @param errorMessage
* @param errorCode
* @param correlationId
* @param timestamp
*/
public IdentityServiceError(Date timestamp, String correlationId, String errorCode, String errorMessage) {
super();
this.timestamp = timestamp;
this.correlationId = correlationId;
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
/**
* Message timestamp
*
* The creation time of the message.
* (Required)
*
* @return
* The timestamp
*/
@JsonProperty("timestamp")
public Date getTimestamp() {
return timestamp;
}
/**
* Message timestamp
*
* The creation time of the message.
* (Required)
*
* @param timestamp
* The timestamp
*/
@JsonProperty("timestamp")
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
/**
* Correlation identifier
*
* The correlation identifier of the message.
* (Required)
*
* @return
* The correlationId
*/
@JsonProperty("correlationId")
public String getCorrelationId() {
return correlationId;
}
/**
* Correlation identifier
*
* The correlation identifier of the message.
* (Required)
*
* @param correlationId
* The correlationId
*/
@JsonProperty("correlationId")
public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}
/**
* Error code
*
* The error code provided by the service.
* (Required)
*
* @return
* The errorCode
*/
@JsonProperty("errorCode")
public String getErrorCode() {
return errorCode;
}
/**
* Error code
*
* The error code provided by the service.
* (Required)
*
* @param errorCode
* The errorCode
*/
@JsonProperty("errorCode")
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
* Error message
*
* The error details provided by the service.
* (Required)
*
* @return
* The errorMessage
*/
@JsonProperty("errorMessage")
public String getErrorMessage() {
return errorMessage;
}
/**
* Error message
*
* The error details provided by the service.
* (Required)
*
* @param errorMessage
* The errorMessage
*/
@JsonProperty("errorMessage")
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(timestamp).append(correlationId).append(errorCode).append(errorMessage).toHashCode();
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof IdentityServiceError) == false) {
return false;
}
IdentityServiceError rhs = ((IdentityServiceError) other);
return new EqualsBuilder().append(timestamp, rhs.timestamp).append(correlationId, rhs.correlationId).append(errorCode, rhs.errorCode).append(errorMessage, rhs.errorMessage).isEquals();
}
}