Package org.apache.olingo.commons.api.ex
Class ODataError
java.lang.Object
org.apache.olingo.commons.api.ex.ODataError
- Direct Known Subclasses:
ODataServerError
OData error.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets server defined additional properties.getCode()
The value for the code name/value pair is a language-independent string.Gets error details.Gets server defined key-value pairs for debug environment only.The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.The value for the target name/value pair is the target of the particular error (for example, the name of the property in error).setAdditionalProperties
(Map<String, Object> additionalProperties) Sets server defined additional propertiesThe value for the code name/value pair is a language-independent string.setDetails
(List<ODataErrorDetail> details) Sets error details.setInnerError
(Map<String, String> innerError) Sets server defined key-value pairs for debug environment only.setMessage
(String message) The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.The value for the target name/value pair is the target of the particular error (for example, the name of the property in error).
-
Constructor Details
-
ODataError
public ODataError()
-
-
Method Details
-
getCode
The value for the code name/value pair is a language-independent string. Its value is a service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. MAY be null.- Returns:
- the error code as a string
-
setCode
The value for the code name/value pair is a language-independent string. Its value is a service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. MAY be null.- Parameters:
code
- the service defined error code for this error- Returns:
- this for method chaining
-
getMessage
The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error. MUST not be null- Returns:
- the message string
-
setMessage
The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error. MUST not be null- Parameters:
message
- message for this error- Returns:
- this for method chaining
-
getTarget
The value for the target name/value pair is the target of the particular error (for example, the name of the property in error). MAY be null.- Returns:
- the target string
-
setTarget
The value for the target name/value pair is the target of the particular error (for example, the name of the property in error). MAY be null.- Parameters:
target
- target to which this error is related to- Returns:
- this for method chaining
-
getDetails
Gets error details.- Returns:
- ODataErrorDetail list.
-
setDetails
Sets error details.- Returns:
- this for method chaining.
-
getInnerError
Gets server defined key-value pairs for debug environment only.- Returns:
- a pair representing server defined object. MAY be null.
-
setInnerError
Sets server defined key-value pairs for debug environment only.- Returns:
- this for method chaining.
-
setAdditionalProperties
Sets server defined additional properties- Parameters:
additionalProperties
-- Returns:
- this for method chaining.
-
getAdditionalProperties
Gets server defined additional properties.- Returns:
- a pair representing server defined object.
-