Class AttributeCreated

  • All Implemented Interfaces:
    org.eclipse.ditto.base.model.entity.id.WithEntityId, org.eclipse.ditto.base.model.headers.DittoHeadersSettable<AttributeCreated>, 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.events.Event<AttributeCreated>, org.eclipse.ditto.base.model.signals.events.EventsourcedEvent<AttributeCreated>, org.eclipse.ditto.base.model.signals.Signal<AttributeCreated>, org.eclipse.ditto.base.model.signals.SignalWithEntityId<AttributeCreated>, org.eclipse.ditto.base.model.signals.WithName, org.eclipse.ditto.base.model.signals.WithOptionalEntity, org.eclipse.ditto.base.model.signals.WithResource, org.eclipse.ditto.base.model.signals.WithType, ThingEvent<AttributeCreated>, ThingModifiedEvent<AttributeCreated>, WithThingId

    @Immutable
    public final class AttributeCreated
    extends AbstractThingEvent<AttributeCreated>
    implements ThingModifiedEvent<AttributeCreated>
    This event is emitted after an Attribute was created.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.signals.events.Event

        org.eclipse.ditto.base.model.signals.events.Event.JsonFields
      • Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.signals.events.EventsourcedEvent

        org.eclipse.ditto.base.model.signals.events.EventsourcedEvent.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>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NAME
      Name of the "Thing Attribute Created" event.
      static java.lang.String TYPE
      Type of this event.
      • Fields inherited from interface org.eclipse.ditto.base.model.signals.events.Event

        DEFAULT_REVISION, TYPE_QUALIFIER
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void appendPayloadAndBuild​(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 boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      static AttributeCreated fromJson​(java.lang.String jsonString, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Creates a new AttributeCreated from a JSON string.
      static AttributeCreated fromJson​(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Creates a new AttributeCreated from a JSON object.
      org.eclipse.ditto.json.JsonPointer getAttributePointer()
      Returns the key of the attribute created.
      org.eclipse.ditto.json.JsonValue getAttributeValue()
      Returns the value of the attribute created.
      java.util.Optional<org.eclipse.ditto.json.JsonValue> getEntity​(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion)  
      org.eclipse.ditto.json.JsonPointer getResourcePath()  
      int hashCode()  
      static AttributeCreated of​(ThingId thingId, org.eclipse.ditto.json.JsonPointer attributePointer, org.eclipse.ditto.json.JsonValue attributeValue, long revision, java.time.Instant timestamp, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.base.model.entity.metadata.Metadata metadata)
      Constructs a new AttributeCreated object.
      AttributeCreated setDittoHeaders​(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)  
      AttributeCreated setRevision​(long revision)  
      java.lang.String toString()  
      • Methods inherited from class org.eclipse.ditto.base.model.signals.events.AbstractEventsourcedEvent

        getRevision, toJson
      • Methods inherited from class org.eclipse.ditto.base.model.signals.events.AbstractEvent

        getDittoHeaders, getManifest, getMetadata, getTimestamp, getType
      • 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.events.Event

        getImplementedSchemaVersion, getMetadata, getTimestamp, getType, toJson
      • Methods inherited from interface org.eclipse.ditto.base.model.signals.events.EventsourcedEvent

        getRevision
      • 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, toJson, toJsonString, toJsonString
      • Methods inherited from interface org.eclipse.ditto.base.model.signals.Signal

        getName
      • Methods inherited from interface org.eclipse.ditto.base.model.headers.WithDittoHeaders

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

        getManifest
      • Methods inherited from interface org.eclipse.ditto.base.model.signals.WithOptionalEntity

        getEntity
    • Field Detail

      • NAME

        public static final java.lang.String NAME
        Name of the "Thing Attribute Created" event.
        See Also:
        Constant Field Values
    • Method Detail

      • of

        public static AttributeCreated of​(ThingId thingId,
                                          org.eclipse.ditto.json.JsonPointer attributePointer,
                                          org.eclipse.ditto.json.JsonValue attributeValue,
                                          long revision,
                                          @Nullable
                                          java.time.Instant timestamp,
                                          org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders,
                                          @Nullable
                                          org.eclipse.ditto.base.model.entity.metadata.Metadata metadata)
        Constructs a new AttributeCreated object.
        Parameters:
        thingId - the ID of the Thing with which this event is associated.
        attributePointer - the pointer of the attribute with which this event is associated.
        attributeValue - the value of the attribute with which this event is associated.
        revision - the revision of the Thing.
        timestamp - the timestamp of this event.
        dittoHeaders - the headers of the command which was the cause of this event.
        metadata - the metadata to apply for the event.
        Returns:
        the AttributeCreated created.
        Throws:
        java.lang.NullPointerException - if any argument but timestamp and metadata is null.
        Since:
        1.3.0
      • fromJson

        public static AttributeCreated fromJson​(java.lang.String jsonString,
                                                org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
        Creates a new AttributeCreated from a JSON string.
        Parameters:
        jsonString - the JSON string of which a new AttributeCreated instance is to be deleted.
        dittoHeaders - the headers of the command which was the cause of this event.
        Returns:
        the AttributeCreated which was deleted from the given JSON string.
        Throws:
        java.lang.NullPointerException - if jsonString is null.
        org.eclipse.ditto.json.JsonParseException - if the passed in jsonString was not in the expected 'AttributeCreated' format.
      • fromJson

        public static AttributeCreated fromJson​(org.eclipse.ditto.json.JsonObject jsonObject,
                                                org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
        Creates a new AttributeCreated from a JSON object.
        Parameters:
        jsonObject - the JSON object from which a new AttributeCreated instance is to be created.
        dittoHeaders - the headers of the command which was the cause of this event.
        Returns:
        the AttributeCreated which was created from the given JSON object.
        Throws:
        java.lang.NullPointerException - if jsonObject is null.
        org.eclipse.ditto.json.JsonParseException - if the passed in jsonObject was not in the expected 'AttributeCreated' format.
      • getAttributePointer

        public org.eclipse.ditto.json.JsonPointer getAttributePointer()
        Returns the key of the attribute created.
        Returns:
        the key of the attribute created.
      • getAttributeValue

        public org.eclipse.ditto.json.JsonValue getAttributeValue()
        Returns the value of the attribute created.
        Returns:
        the value of the attribute created.
      • getEntity

        public java.util.Optional<org.eclipse.ditto.json.JsonValue> getEntity​(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion)
        Specified by:
        getEntity in interface org.eclipse.ditto.base.model.signals.WithOptionalEntity
      • getResourcePath

        public org.eclipse.ditto.json.JsonPointer getResourcePath()
        Specified by:
        getResourcePath in interface org.eclipse.ditto.base.model.signals.WithResource
      • setRevision

        public AttributeCreated setRevision​(long revision)
        Specified by:
        setRevision in class org.eclipse.ditto.base.model.signals.events.AbstractEventsourcedEvent<AttributeCreated>
      • appendPayloadAndBuild

        protected void appendPayloadAndBuild​(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:
        appendPayloadAndBuild in class org.eclipse.ditto.base.model.signals.events.AbstractEvent<AttributeCreated>