Package com.adyen.model.paymentsapp
Class DefaultErrorResponseEntity
- java.lang.Object
-
- com.adyen.model.paymentsapp.DefaultErrorResponseEntity
-
public class DefaultErrorResponseEntity extends Object
Standardized error response following RFC-7807 format
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_DETAILstatic StringJSON_PROPERTY_ERROR_CODEstatic StringJSON_PROPERTY_INSTANCEstatic StringJSON_PROPERTY_INVALID_FIELDSstatic StringJSON_PROPERTY_REQUEST_IDstatic StringJSON_PROPERTY_STATUSstatic StringJSON_PROPERTY_TITLEstatic StringJSON_PROPERTY_TYPE
-
Constructor Summary
Constructors Constructor Description DefaultErrorResponseEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultErrorResponseEntityaddInvalidFieldsItem(InvalidField invalidFieldsItem)DefaultErrorResponseEntitydetail(String detail)booleanequals(Object o)Return true if this DefaultErrorResponseEntity object is equal to o.DefaultErrorResponseEntityerrorCode(String errorCode)static DefaultErrorResponseEntityfromJson(String jsonString)Create an instance of DefaultErrorResponseEntity given an JSON stringStringgetDetail()A human-readable explanation specific to this occurrence of the problem.StringgetErrorCode()Unique business error code.StringgetInstance()A URI that identifies the specific occurrence of the problem if applicable.List<InvalidField>getInvalidFields()Array of fields with validation errors when applicable.StringgetRequestId()The unique reference for the request.IntegergetStatus()The HTTP status code.StringgetTitle()A short, human-readable summary of the problem type.StringgetType()A URI that identifies the validation error type.inthashCode()DefaultErrorResponseEntityinstance(String instance)DefaultErrorResponseEntityinvalidFields(List<InvalidField> invalidFields)DefaultErrorResponseEntityrequestId(String requestId)voidsetDetail(String detail)A human-readable explanation specific to this occurrence of the problem.voidsetErrorCode(String errorCode)Unique business error code.voidsetInstance(String instance)A URI that identifies the specific occurrence of the problem if applicable.voidsetInvalidFields(List<InvalidField> invalidFields)Array of fields with validation errors when applicable.voidsetRequestId(String requestId)The unique reference for the request.voidsetStatus(Integer status)The HTTP status code.voidsetTitle(String title)A short, human-readable summary of the problem type.voidsetType(String type)A URI that identifies the validation error type.DefaultErrorResponseEntitystatus(Integer status)DefaultErrorResponseEntitytitle(String title)StringtoJson()Convert an instance of DefaultErrorResponseEntity to an JSON stringStringtoString()DefaultErrorResponseEntitytype(String type)
-
-
-
Field Detail
-
JSON_PROPERTY_DETAIL
public static final String JSON_PROPERTY_DETAIL
- See Also:
- Constant Field Values
-
JSON_PROPERTY_ERROR_CODE
public static final String JSON_PROPERTY_ERROR_CODE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_INSTANCE
public static final String JSON_PROPERTY_INSTANCE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_INVALID_FIELDS
public static final String JSON_PROPERTY_INVALID_FIELDS
- See Also:
- Constant Field Values
-
JSON_PROPERTY_REQUEST_ID
public static final String JSON_PROPERTY_REQUEST_ID
- See Also:
- Constant Field Values
-
JSON_PROPERTY_STATUS
public static final String JSON_PROPERTY_STATUS
- See Also:
- Constant Field Values
-
JSON_PROPERTY_TITLE
public static final String JSON_PROPERTY_TITLE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_TYPE
public static final String JSON_PROPERTY_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
detail
public DefaultErrorResponseEntity detail(String detail)
-
getDetail
public String getDetail()
A human-readable explanation specific to this occurrence of the problem.- Returns:
- detail
-
setDetail
public void setDetail(String detail)
A human-readable explanation specific to this occurrence of the problem.- Parameters:
detail-
-
errorCode
public DefaultErrorResponseEntity errorCode(String errorCode)
-
getErrorCode
public String getErrorCode()
Unique business error code.- Returns:
- errorCode
-
setErrorCode
public void setErrorCode(String errorCode)
Unique business error code.- Parameters:
errorCode-
-
instance
public DefaultErrorResponseEntity instance(String instance)
-
getInstance
public String getInstance()
A URI that identifies the specific occurrence of the problem if applicable.- Returns:
- instance
-
setInstance
public void setInstance(String instance)
A URI that identifies the specific occurrence of the problem if applicable.- Parameters:
instance-
-
invalidFields
public DefaultErrorResponseEntity invalidFields(List<InvalidField> invalidFields)
-
addInvalidFieldsItem
public DefaultErrorResponseEntity addInvalidFieldsItem(InvalidField invalidFieldsItem)
-
getInvalidFields
public List<InvalidField> getInvalidFields()
Array of fields with validation errors when applicable.- Returns:
- invalidFields
-
setInvalidFields
public void setInvalidFields(List<InvalidField> invalidFields)
Array of fields with validation errors when applicable.- Parameters:
invalidFields-
-
requestId
public DefaultErrorResponseEntity requestId(String requestId)
-
getRequestId
public String getRequestId()
The unique reference for the request.- Returns:
- requestId
-
setRequestId
public void setRequestId(String requestId)
The unique reference for the request.- Parameters:
requestId-
-
status
public DefaultErrorResponseEntity status(Integer status)
-
getStatus
public Integer getStatus()
The HTTP status code.- Returns:
- status
-
setStatus
public void setStatus(Integer status)
The HTTP status code.- Parameters:
status-
-
title
public DefaultErrorResponseEntity title(String title)
-
getTitle
public String getTitle()
A short, human-readable summary of the problem type.- Returns:
- title
-
setTitle
public void setTitle(String title)
A short, human-readable summary of the problem type.- Parameters:
title-
-
type
public DefaultErrorResponseEntity type(String type)
-
getType
public String getType()
A URI that identifies the validation error type. It points to human-readable documentation for the problem type.- Returns:
- type
-
setType
public void setType(String type)
A URI that identifies the validation error type. It points to human-readable documentation for the problem type.- Parameters:
type-
-
equals
public boolean equals(Object o)
Return true if this DefaultErrorResponseEntity object is equal to o.
-
fromJson
public static DefaultErrorResponseEntity fromJson(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Create an instance of DefaultErrorResponseEntity given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of DefaultErrorResponseEntity
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON string is invalid with respect to DefaultErrorResponseEntity
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
Convert an instance of DefaultErrorResponseEntity to an JSON string- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-