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.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 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Type 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.base.model.signals.Signal

    CHANNEL_LIVE, CHANNEL_TWIN

    Fields inherited from interface org.eclipse.ditto.things.model.signals.commands.ThingCommandResponse

    TYPE_PREFIX

    Fields 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 Type
    Method
    Description
    protected void
    appendPayload(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder, org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, Predicate<org.eclipse.ditto.json.JsonField> thePredicate)
     
    protected boolean
     
    boolean
     
    fromJson(String jsonString, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Creates a new ThingErrorResponse containing the causing DittoRuntimeException which is deserialized from the passed jsonString.
    fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Creates a new ThingErrorResponse containing the causing DittoRuntimeException which is deserialized from the passed jsonObject.
    org.eclipse.ditto.base.model.exceptions.DittoRuntimeException
     
     
    org.eclipse.ditto.json.JsonPointer
     
    int
     
    of(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)
    Creates a new ThingErrorResponse for the specified dittoRuntimeException.
    of(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Creates a new ThingErrorResponse for the specified dittoRuntimeException.
    of(ThingId thingId, org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)
    Creates a new ThingErrorResponse for the specified dittoRuntimeException.
    of(ThingId thingId, org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Creates a new ThingErrorResponse for the specified dittoRuntimeException.
    setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
     
     

    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.base.model.signals.Signal

    getName

    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

    Methods inherited from interface org.eclipse.ditto.base.model.signals.commands.WithHttpStatus

    getHttpStatus

    Methods inherited from interface org.eclipse.ditto.base.model.headers.WithManifest

    getManifest

    Methods inherited from interface org.eclipse.ditto.base.model.signals.WithType

    getType
  • Field Details

  • Method Details

    • of

      public static ThingErrorResponse of(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)
      Creates a new ThingErrorResponse for the specified dittoRuntimeException.
      Parameters:
      dittoRuntimeException - the exception.
      Returns:
      the response.
      Throws:
      NullPointerException - if one of the arguments is null.
    • of

      public static ThingErrorResponse of(ThingId thingId, org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException)
      Creates a new ThingErrorResponse for the specified dittoRuntimeException.
      Parameters:
      thingId - the Thing ID which was related to the exception.
      dittoRuntimeException - the exception.
      Returns:
      the response.
      Throws:
      NullPointerException - if one of the arguments is null.
    • of

      public static ThingErrorResponse of(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException dittoRuntimeException, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Creates a new ThingErrorResponse for the specified dittoRuntimeException.
      Parameters:
      dittoRuntimeException - the exception.
      dittoHeaders - the headers of the command which caused the exception.
      Returns:
      the response.
      Throws:
      NullPointerException - if one of the arguments is null.
    • 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 new ThingErrorResponse for the specified dittoRuntimeException.
      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 is null.
    • fromJson

      public static ThingErrorResponse fromJson(String jsonString, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Creates a new ThingErrorResponse containing the causing DittoRuntimeException which is deserialized from the passed jsonString.
      Parameters:
      jsonString - the JSON string representation of the causing DittoRuntimeException.
      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 new ThingErrorResponse containing the causing DittoRuntimeException which is deserialized from the passed jsonObject.
      Parameters:
      jsonObject - the JSON representation of the causing DittoRuntimeException.
      dittoHeaders - the DittoHeaders to use.
      Returns:
      the ThingErrorResponse.
    • getEntityId

      public ThingId getEntityId()
      Specified by:
      getEntityId in interface org.eclipse.ditto.base.model.entity.id.WithEntityId
      Specified by:
      getEntityId in interface WithThingId
    • getDittoRuntimeException

      public org.eclipse.ditto.base.model.exceptions.DittoRuntimeException getDittoRuntimeException()
      Specified by:
      getDittoRuntimeException in interface org.eclipse.ditto.base.model.signals.commands.ErrorResponse<ThingErrorResponse>
    • getResourcePath

      public org.eclipse.ditto.json.JsonPointer getResourcePath()
      Specified by:
      getResourcePath in interface org.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:
      appendPayload in class org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
    • setDittoHeaders

      public ThingErrorResponse setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Specified by:
      setDittoHeaders in interface org.eclipse.ditto.base.model.signals.commands.CommandResponse<ThingErrorResponse>
      Specified by:
      setDittoHeaders in interface org.eclipse.ditto.base.model.headers.DittoHeadersSettable<ThingErrorResponse>
      Specified by:
      setDittoHeaders in interface org.eclipse.ditto.base.model.signals.commands.ErrorResponse<ThingErrorResponse>
      Specified by:
      setDittoHeaders in interface ThingCommandResponse<ThingErrorResponse>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
    • canEqual

      protected boolean canEqual(@Nullable Object other)
      Overrides:
      canEqual in class org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>
    • toString

      public String toString()
      Overrides:
      toString in class org.eclipse.ditto.base.model.signals.commands.AbstractCommandResponse<ThingErrorResponse>