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 a
ThingCommand which 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.JsonFieldsNested 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 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 Object> Nested classes/interfaces inherited from interface org.eclipse.ditto.things.model.signals.commands.ThingCommandResponse
ThingCommandResponse.JsonFields -
Field Summary
FieldsFields inherited from class org.eclipse.ditto.base.model.signals.commands.AbstractErrorResponse
FALLBACK_IDFields inherited from interface org.eclipse.ditto.base.model.signals.commands.CommandResponse
TYPE_QUALIFIERFields inherited from interface org.eclipse.ditto.base.model.signals.Signal
CHANNEL_LIVE, CHANNEL_TWINFields inherited from interface org.eclipse.ditto.things.model.signals.commands.ThingCommandResponse
TYPE_PREFIXFields inherited from interface org.eclipse.ditto.base.model.signals.WithType
MESSAGES_COMMAND_RESPONSES_PREFIX, MESSAGES_COMMANDS_PREFIX, POLICY_ANNOUNCEMENT_PREFIX, THINGS_COMMAND_RESPONSES_PREFIX, THINGS_COMMANDS_PREFIX, THINGS_EVENTS_PREFIX -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendPayload(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder, org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, Predicate<org.eclipse.ditto.json.JsonField> thePredicate) protected booleanbooleanstatic ThingErrorResponseCreates 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.DittoRuntimeExceptionorg.eclipse.ditto.json.JsonPointerinthashCode()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.setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders) toString()Methods inherited from class org.eclipse.ditto.base.model.signals.commands.AbstractErrorResponse
buildExceptionFromJsonMethods inherited from class org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse
getDittoHeaders, getHttpStatus, getManifest, getType, toJsonMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.ditto.base.model.signals.commands.CommandResponse
getImplementedSchemaVersion, isOfExpectedResponseType, toJson, toJsonMethods inherited from interface org.eclipse.ditto.base.model.signals.commands.ErrorResponse
getResponseTypeMethods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
getLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJsonStringMethods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate
toJson, toJsonString, toJsonStringMethods inherited from interface org.eclipse.ditto.base.model.signals.Signal
getNameMethods inherited from interface org.eclipse.ditto.things.model.signals.commands.ThingCommandResponse
getResourceTypeMethods inherited from interface org.eclipse.ditto.base.model.headers.WithDittoHeaders
getDittoHeadersMethods inherited from interface org.eclipse.ditto.base.model.signals.commands.WithHttpStatus
getHttpStatusMethods inherited from interface org.eclipse.ditto.base.model.headers.WithManifest
getManifestMethods inherited from interface org.eclipse.ditto.base.model.signals.WithType
getType
-
Field Details
-
TYPE
Type of this response.- See Also:
-
-
Method Details
-
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:
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:
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:
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:
NullPointerException- if one of the arguments isnull.
-
fromJson
public static ThingErrorResponse fromJson(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
- 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, 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
- Overrides:
equalsin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-
canEqual
- Overrides:
canEqualin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-
toString
- Overrides:
toStringin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
-