public class ODataServiceError extends Object implements ODataServiceErrorDetails
Constructor and Description |
---|
ODataServiceError(String oDataCode,
String oDataMessage,
String target) |
ODataServiceError(String oDataCode,
String oDataMessage,
String target,
List<ODataServiceErrorDetails> details,
Map<String,Object> innerError) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
static ODataServiceError |
fromResultObject(ResultObject resultObject,
ODataProtocol protocol)
SDK internal method to construct an OData error from a
ResultObject . |
List<ODataServiceErrorDetails> |
getDetails()
A list of all contained nested
ODataServiceErrors . |
Map<String,Object> |
getInnerError()
The
innererror field of the response as a key-value map. |
String |
getODataCode()
Language independent OData error response code.
|
String |
getODataMessage()
Language dependent OData error message.
|
io.vavr.control.Option<String> |
getTarget()
Optional OData service specific hint for origin of the error.
|
int |
hashCode() |
String |
toString() |
public ODataServiceError(@Nonnull String oDataCode, @Nonnull String oDataMessage, @Nullable String target)
@Nonnull public List<ODataServiceErrorDetails> getDetails()
ODataServiceErrors
. If none were found in the
response this list is empty. In case of OData V2 this corresponds to the errordetails
field of
innererror
.getInnerError()
@Nonnull public Map<String,Object> getInnerError()
innererror
field of the response as a key-value map. If this field was not present on the response
this map will be empty. In case of OData V2 the nested field errordetails
is available separately via
getDetails()
.innererror
field.getDetails()
@Beta @Nonnull public static ODataServiceError fromResultObject(@Nonnull ResultObject resultObject, @Nonnull ODataProtocol protocol) throws UnsupportedOperationException
ResultObject
.resultObject
- The ResultObject
that should be parsed.protocol
- The OData protocol version
that should be assumed.ODataServiceError
.UnsupportedOperationException
- if parsing the result object failed.@Nonnull public io.vavr.control.Option<String> getTarget()
ODataServiceErrorDetails
getTarget
in interface ODataServiceErrorDetails
optional
target.@Nonnull public String getODataCode()
ODataServiceErrorDetails
getODataCode
in interface ODataServiceErrorDetails
@Nonnull public String getODataMessage()
ODataServiceErrorDetails
getODataMessage
in interface ODataServiceErrorDetails
Copyright © 2021 SAP SE. All rights reserved.