Class ThingIdNotExplicitlySettableException

  • All Implemented Interfaces:
    Serializable, org.eclipse.ditto.model.base.headers.WithDittoHeaders<org.eclipse.ditto.model.base.exceptions.DittoRuntimeException>, org.eclipse.ditto.model.base.headers.WithManifest, org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,​org.eclipse.ditto.json.JsonField>, org.eclipse.ditto.model.things.ThingException

    @Immutable
    public final class ThingIdNotExplicitlySettableException
    extends org.eclipse.ditto.model.base.exceptions.DittoRuntimeException
    implements org.eclipse.ditto.model.things.ThingException
    Thrown if either for a REST POST or PUT request for creating a Thing it was tried to set an explicit thingId in the JSON body.
    See Also:
    Serialized Form
    • Method Detail

      • newBuilder

        public static ThingIdNotExplicitlySettableException.Builder newBuilder​(boolean isPostMethod)
        Deprecated.
        this is legacy use where we only needed to distinguish between put and post. Now whe have a third option "ditto protocol" as well.
        A mutable builder for a ThingIdNotExplicitlySettableException.
        Parameters:
        isPostMethod - whether the exception is created for a POST request (true) or for a PUT request ( false).
        Returns:
        the builder.
      • fromJson

        public static ThingIdNotExplicitlySettableException fromJson​(org.eclipse.ditto.json.JsonObject jsonObject,
                                                                     org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
        Constructs a new ThingIdNotExplicitlySettableException object with the exception message extracted from the given JSON object.
        Parameters:
        jsonObject - the JSON to read the DittoRuntimeException.JsonFields.MESSAGE field from.
        dittoHeaders - the headers of the command which resulted in this exception.
        Returns:
        the new ThingIdNotExplicitlySettableException.
        Throws:
        NullPointerException - if any argument is null.
        org.eclipse.ditto.json.JsonMissingFieldException - if the jsonObject does not have the DittoRuntimeException.JsonFields.MESSAGE field.
        org.eclipse.ditto.json.JsonParseException - if the passed in jsonObject was not in the expected format.
      • setDittoHeaders

        public org.eclipse.ditto.model.base.exceptions.DittoRuntimeException setDittoHeaders​(org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
        Specified by:
        setDittoHeaders in interface org.eclipse.ditto.model.base.headers.WithDittoHeaders<org.eclipse.ditto.model.base.exceptions.DittoRuntimeException>
        Overrides:
        setDittoHeaders in class org.eclipse.ditto.model.base.exceptions.DittoRuntimeException
      • fromMessage

        public static ThingIdNotExplicitlySettableException fromMessage​(String message,
                                                                        org.eclipse.ditto.model.base.headers.DittoHeaders dittoHeaders)
        Deprecated.
        This method will eventually be deleted, because it's not used anywhere.
        Constructs a new ThingIdNotExplicitlySettableException object with the given exception message.
        Parameters:
        message - detail message. This message can be later retrieved by the Throwable.getMessage() method.
        dittoHeaders - the headers of the command which resulted in this exception.
        Returns:
        the new ThingIdNotExplicitlySettableException.