Class AttributeCreated
java.lang.Object
org.eclipse.ditto.base.model.signals.events.AbstractEvent<T>
org.eclipse.ditto.base.model.signals.events.AbstractEventsourcedEvent<T>
org.eclipse.ditto.things.model.signals.events.AbstractThingEvent<AttributeCreated>
org.eclipse.ditto.things.model.signals.events.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<AttributeCreated>,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.JsonFieldsNested classes/interfaces inherited from interface org.eclipse.ditto.base.model.signals.events.EventsourcedEvent
org.eclipse.ditto.base.model.signals.events.EventsourcedEvent.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.events.ThingEvent
ThingEvent.JsonFields -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the "Thing Attribute Created" event.static final StringType of this event.Fields inherited from interface org.eclipse.ditto.base.model.signals.events.Event
DEFAULT_REVISION, 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.events.ThingEvent
RESOURCE_TYPE, 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 AttributeCreatedCreates a newAttributeCreatedfrom a JSON string.static AttributeCreatedfromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders) Creates a newAttributeCreatedfrom a JSON object.org.eclipse.ditto.json.JsonPointerReturns the key of the attribute created.org.eclipse.ditto.json.JsonValueReturns the value of the attribute created.org.eclipse.ditto.base.model.signals.commands.Command.CategoryGet the category of the command that caused this event.Optional<org.eclipse.ditto.json.JsonValue>getEntity(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion) org.eclipse.ditto.json.JsonPointerinthashCode()static AttributeCreatedof(ThingId thingId, org.eclipse.ditto.json.JsonPointer attributePointer, org.eclipse.ditto.json.JsonValue attributeValue, long revision, Instant timestamp, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.base.model.entity.metadata.Metadata metadata) Constructs a newAttributeCreatedobject.setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders) setEntity(org.eclipse.ditto.json.JsonValue entity) setRevision(long revision) toString()Methods inherited from class org.eclipse.ditto.things.model.signals.events.AbstractThingEvent
getEntityIdMethods inherited from class org.eclipse.ditto.base.model.signals.events.AbstractEventsourcedEvent
getRevision, toJsonMethods inherited from class org.eclipse.ditto.base.model.signals.events.AbstractEvent
getDittoHeaders, getManifest, getMetadata, getTimestamp, getTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.ditto.base.model.signals.events.Event
getImplementedSchemaVersion, getMetadata, getTimestamp, getType, toJsonMethods inherited from interface org.eclipse.ditto.base.model.signals.events.EventsourcedEvent
getRevisionMethods 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, toJson, toJsonString, toJsonStringMethods inherited from interface org.eclipse.ditto.base.model.signals.Signal
getNameMethods inherited from interface org.eclipse.ditto.things.model.signals.events.ThingEvent
getResourceTypeMethods inherited from interface org.eclipse.ditto.base.model.headers.WithDittoHeaders
getDittoHeadersMethods inherited from interface org.eclipse.ditto.base.model.headers.WithManifest
getManifestMethods inherited from interface org.eclipse.ditto.base.model.signals.WithOptionalEntity
getEntityMethods inherited from interface org.eclipse.ditto.things.model.WithThingId
getEntityId
-
Field Details
-
NAME
Name of the "Thing Attribute Created" event.- See Also:
-
TYPE
Type of this event.- See Also:
-
-
Method Details
-
of
public static AttributeCreated of(ThingId thingId, org.eclipse.ditto.json.JsonPointer attributePointer, org.eclipse.ditto.json.JsonValue attributeValue, long revision, @Nullable Instant timestamp, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, @Nullable org.eclipse.ditto.base.model.entity.metadata.Metadata metadata) Constructs a newAttributeCreatedobject.- 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:
NullPointerException- if any argument buttimestampandmetadataisnull.- Since:
- 1.3.0
-
fromJson
public static AttributeCreated fromJson(String jsonString, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders) Creates a newAttributeCreatedfrom 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
AttributeCreatedwhich was deleted from the given JSON string. - Throws:
NullPointerException- ifjsonStringisnull.org.eclipse.ditto.json.JsonParseException- if the passed injsonStringwas 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 newAttributeCreatedfrom 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
AttributeCreatedwhich was created from the given JSON object. - Throws:
NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.json.JsonParseException- if the passed injsonObjectwas 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 Optional<org.eclipse.ditto.json.JsonValue> getEntity(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion) - Specified by:
getEntityin interfaceorg.eclipse.ditto.base.model.signals.WithOptionalEntity<AttributeCreated>
-
setEntity
- Specified by:
setEntityin interfaceorg.eclipse.ditto.base.model.signals.WithOptionalEntity<AttributeCreated>
-
getResourcePath
public org.eclipse.ditto.json.JsonPointer getResourcePath()- Specified by:
getResourcePathin interfaceorg.eclipse.ditto.base.model.signals.WithResource
-
setRevision
- Specified by:
setRevisionin classorg.eclipse.ditto.base.model.signals.events.AbstractEventsourcedEvent<AttributeCreated>
-
setDittoHeaders
public AttributeCreated setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders) - Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.headers.DittoHeadersSettable<AttributeCreated>- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.signals.events.EventsourcedEvent<AttributeCreated>- Specified by:
setDittoHeadersin interfaceThingEvent<AttributeCreated>- Specified by:
setDittoHeadersin interfaceThingModifiedEvent<AttributeCreated>
-
getCommandCategory
public org.eclipse.ditto.base.model.signals.commands.Command.Category getCommandCategory()Description copied from interface:ThingEventGet the category of the command that caused this event.- Specified by:
getCommandCategoryin interfaceThingEvent<AttributeCreated>- Returns:
- the command category.
-
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.events.AbstractEvent<AttributeCreated>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractThingEvent<AttributeCreated>
-
equals
- Overrides:
equalsin classAbstractThingEvent<AttributeCreated>
-
canEqual
- Overrides:
canEqualin classAbstractThingEvent<AttributeCreated>
-
toString
- Overrides:
toStringin classAbstractThingEvent<AttributeCreated>
-