Class ThingErrorResponse
- java.lang.Object
-
- org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<T>
-
- org.eclipse.ditto.base.model.signals.commands.AbstractErrorResponse<ThingErrorResponse>
-
- org.eclipse.ditto.things.model.signals.commands.ThingErrorResponse
-
- All Implemented Interfaces:
org.eclipse.ditto.base.model.entity.id.WithEntityId,org.eclipse.ditto.base.model.headers.DittoHeadersSettable<ThingErrorResponse>,org.eclipse.ditto.base.model.headers.WithDittoHeaders,org.eclipse.ditto.base.model.headers.WithManifest,org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>,org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,org.eclipse.ditto.json.JsonField>,org.eclipse.ditto.base.model.signals.commands.CommandResponse<ThingErrorResponse>,org.eclipse.ditto.base.model.signals.commands.ErrorResponse<ThingErrorResponse>,org.eclipse.ditto.base.model.signals.commands.WithHttpStatus,org.eclipse.ditto.base.model.signals.Signal<ThingErrorResponse>,org.eclipse.ditto.base.model.signals.SignalWithEntityId<ThingErrorResponse>,org.eclipse.ditto.base.model.signals.WithName,org.eclipse.ditto.base.model.signals.WithResource,org.eclipse.ditto.base.model.signals.WithType,ThingCommandResponse<ThingErrorResponse>,WithThingId
@Immutable public final class ThingErrorResponse extends org.eclipse.ditto.base.model.signals.commands.AbstractErrorResponse<ThingErrorResponse> implements ThingCommandResponse<ThingErrorResponse>
Response to aThingCommandwhich wraps the exception thrown while processing the command.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.signals.commands.CommandResponse
org.eclipse.ditto.base.model.signals.commands.CommandResponse.JsonFields
-
Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends java.lang.Object>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.eclipse.ditto.things.model.signals.commands.ThingCommandResponse
ThingCommandResponse.JsonFields
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTYPEType of this response.-
Fields inherited from class org.eclipse.ditto.base.model.signals.commands.AbstractErrorResponse
FALLBACK_ID
-
Fields inherited from interface org.eclipse.ditto.base.model.signals.commands.CommandResponse
TYPE_QUALIFIER
-
Fields inherited from interface org.eclipse.ditto.things.model.signals.commands.ThingCommandResponse
TYPE_PREFIX
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendPayload(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder, org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> thePredicate)protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)static ThingErrorResponsefromJson(java.lang.String jsonString, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)Creates a newThingErrorResponsecontaining the causingDittoRuntimeExceptionwhich is deserialized from the passedjsonString.static ThingErrorResponsefromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)Creates a newThingErrorResponsecontaining the causingDittoRuntimeExceptionwhich is deserialized from the passedjsonObject.org.eclipse.ditto.base.model.exceptions.DittoRuntimeExceptiongetDittoRuntimeException()ThingIdgetEntityId()org.eclipse.ditto.json.JsonPointergetResourcePath()inthashCode()static ThingErrorResponseof(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)Creates a newThingErrorResponsefor the specifieddittoRuntimeException.static ThingErrorResponseof(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)Creates a newThingErrorResponsefor the specifieddittoRuntimeException.static ThingErrorResponseof(ThingId thingId, org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)Creates a newThingErrorResponsefor the specifieddittoRuntimeException.static ThingErrorResponseof(ThingId thingId, org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)Creates a newThingErrorResponsefor the specifieddittoRuntimeException.ThingErrorResponsesetDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)java.lang.StringtoString()-
Methods inherited from class org.eclipse.ditto.base.model.signals.commands.AbstractErrorResponse
buildExceptionFromJson
-
Methods inherited from class org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse
getDittoHeaders, getHttpStatus, getManifest, getType, toJson
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.ditto.base.model.signals.commands.CommandResponse
getImplementedSchemaVersion, isOfExpectedResponseType, toJson, toJson
-
Methods inherited from interface org.eclipse.ditto.base.model.signals.commands.ErrorResponse
getResponseType
-
Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
getLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJsonString
-
Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate
toJson, toJsonString, toJsonString
-
Methods inherited from interface org.eclipse.ditto.things.model.signals.commands.ThingCommandResponse
getResourceType
-
Methods inherited from interface org.eclipse.ditto.base.model.headers.WithDittoHeaders
getDittoHeaders
-
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
Type of this response.- See Also:
- Constant Field Values
-
-
Method Detail
-
of
public static ThingErrorResponse of(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)
Creates a newThingErrorResponsefor the specifieddittoRuntimeException.- Parameters:
dittoRuntimeException- the exception.- Returns:
- the response.
- Throws:
java.lang.NullPointerException- if one of the arguments isnull.
-
of
public static ThingErrorResponse of(ThingId thingId, org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)
Creates a newThingErrorResponsefor the specifieddittoRuntimeException.- Parameters:
thingId- the Thing ID which was related to the exception.dittoRuntimeException- the exception.- Returns:
- the response.
- Throws:
java.lang.NullPointerException- if one of the arguments isnull.
-
of
public static ThingErrorResponse of(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
Creates a newThingErrorResponsefor the specifieddittoRuntimeException.- Parameters:
dittoRuntimeException- the exception.dittoHeaders- the headers of the command which caused the exception.- Returns:
- the response.
- Throws:
java.lang.NullPointerException- if one of the arguments isnull.
-
of
public static ThingErrorResponse of(ThingId thingId, org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
Creates a newThingErrorResponsefor the specifieddittoRuntimeException.- Parameters:
thingId- the Thing's ID.dittoRuntimeException- the exception.dittoHeaders- the headers of the command which caused the exception.- Returns:
- the response.
- Throws:
java.lang.NullPointerException- if one of the arguments isnull.
-
fromJson
public static ThingErrorResponse fromJson(java.lang.String jsonString, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
Creates a newThingErrorResponsecontaining the causingDittoRuntimeExceptionwhich is deserialized from the passedjsonString.- Parameters:
jsonString- the JSON string representation of the causingDittoRuntimeException.dittoHeaders- the DittoHeaders to use.- Returns:
- the ThingErrorResponse.
-
fromJson
public static ThingErrorResponse fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
Creates a newThingErrorResponsecontaining the causingDittoRuntimeExceptionwhich is deserialized from the passedjsonObject.- Parameters:
jsonObject- the JSON representation of the causingDittoRuntimeException.dittoHeaders- the DittoHeaders to use.- Returns:
- the ThingErrorResponse.
-
getEntityId
public ThingId getEntityId()
- Specified by:
getEntityIdin interfaceThingCommandResponse<ThingErrorResponse>- Specified by:
getEntityIdin interfaceorg.eclipse.ditto.base.model.entity.id.WithEntityId- Specified by:
getEntityIdin interfaceWithThingId
-
getDittoRuntimeException
public org.eclipse.ditto.base.model.exceptions.DittoRuntimeException getDittoRuntimeException()
- Specified by:
getDittoRuntimeExceptionin interfaceorg.eclipse.ditto.base.model.signals.commands.ErrorResponse<ThingErrorResponse>
-
getResourcePath
public org.eclipse.ditto.json.JsonPointer getResourcePath()
- Specified by:
getResourcePathin interfaceorg.eclipse.ditto.base.model.signals.WithResource
-
appendPayload
protected void appendPayload(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder, org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> thePredicate)- Specified by:
appendPayloadin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-
setDittoHeaders
public ThingErrorResponse setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.signals.commands.CommandResponse<ThingErrorResponse>- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.headers.DittoHeadersSettable<ThingErrorResponse>- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.signals.commands.ErrorResponse<ThingErrorResponse>- Specified by:
setDittoHeadersin interfaceThingCommandResponse<ThingErrorResponse>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-
equals
public boolean equals(@Nullable java.lang.Object o)- Overrides:
equalsin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-
canEqual
protected boolean canEqual(@Nullable java.lang.Object other)- Overrides:
canEqualin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-
-