Package org.eclipse.ditto.things.api
Class ThingSnapshotTaken
java.lang.Object
org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
org.eclipse.ditto.things.api.ThingSnapshotTaken
- All Implemented Interfaces:
org.eclipse.ditto.base.model.entity.id.WithEntityId,org.eclipse.ditto.base.model.headers.DittoHeadersSettable<ThingSnapshotTaken>,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<ThingSnapshotTaken>,org.eclipse.ditto.base.model.signals.events.EventsourcedEvent<ThingSnapshotTaken>,org.eclipse.ditto.base.model.signals.Signal<ThingSnapshotTaken>,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
public final class ThingSnapshotTaken
extends org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
Event published when a thing snapshot is taken.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA mutable builder with a fluent API for creating instances ofThingSnapshotTaken.Nested classes/interfaces inherited from class org.eclipse.ditto.base.api.persistence.SnapshotTaken
org.eclipse.ditto.base.api.persistence.SnapshotTaken.JsonDeserializer, org.eclipse.ditto.base.api.persistence.SnapshotTaken.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> -
Field Summary
FieldsFields inherited from interface org.eclipse.ditto.base.model.signals.events.Event
DEFAULT_REVISION, TYPE_QUALIFIER -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ThingSnapshotTakenfromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders) Deserializes aThingSnapshotTakeninstance from the specified JSON object.org.eclipse.ditto.things.model.ThingIdOptional<org.eclipse.ditto.policies.model.PolicyId>Gets the policy ID associated with the thing for which the snapshot was taken.inthashCode()static ThingSnapshotTaken.BuildernewBuilder(org.eclipse.ditto.things.model.ThingId thingId, long revisionNumber, org.eclipse.ditto.base.api.persistence.PersistenceLifecycle lifecycle, org.eclipse.ditto.json.JsonObject thingJson) Returns a new builder with a fluent API for creating aThingSnapshotTaken.protected ThingSnapshotTakensetDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.json.JsonObject thingJson) org.eclipse.ditto.json.JsonObjecttoJson(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, Predicate<org.eclipse.ditto.json.JsonField> predicate) toString()Methods inherited from class org.eclipse.ditto.base.api.persistence.SnapshotTaken
getDittoHeaders, getEntity, getLifecycle, getManifest, getMetadata, getPersistenceLifecycle, getResourcePath, getRevision, getTimestamp, getType, setDittoHeadersMethods 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, toJsonMethods 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.base.model.signals.WithOptionalEntity
getEntity
-
Field Details
-
PUB_SUB_TOPIC
Pub-sub topic of this event.- See Also:
-
-
Method Details
-
newBuilder
public static ThingSnapshotTaken.Builder newBuilder(org.eclipse.ditto.things.model.ThingId thingId, long revisionNumber, org.eclipse.ditto.base.api.persistence.PersistenceLifecycle lifecycle, org.eclipse.ditto.json.JsonObject thingJson) Returns a new builder with a fluent API for creating aThingSnapshotTaken.- Parameters:
thingId- the ID of the thing of which a snapshot was taken.revisionNumber- the revision number of the thing of which a snapshot was taken.lifecycle- the lifecycle of the thing of which a snapshot was taken.thingJson- the JSON representation of the thing of which a snapshot was taken.- Returns:
- the builder.
- Throws:
NullPointerException- if any argument isnull.
-
fromJson
public static ThingSnapshotTaken fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders) Deserializes aThingSnapshotTakeninstance from the specified JSON object.- Parameters:
jsonObject- the JSON object that should be deserialized.dittoHeaders- the headers of the deserialized event.- Returns:
- the deserialized ThingSnapshotTaken instance.
- Throws:
NullPointerException- if any argument isnull.org.eclipse.ditto.json.JsonMissingFieldException- – ifjsonObjectdid not contain all required fields.org.eclipse.ditto.json.JsonParseException- ifjsonObjectdoes not represent a validThingSnapshotTaken.
-
getPolicyId
Gets the policy ID associated with the thing for which the snapshot was taken.- Returns:
- an Optional containing the policyId, or an empty Optional if the policyId of the Thing is unknown.
-
getEntityId
public org.eclipse.ditto.things.model.ThingId getEntityId()- Specified by:
getEntityIdin interfaceorg.eclipse.ditto.base.model.entity.id.WithEntityId- Specified by:
getEntityIdin classorg.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
-
getPubSubTopic
- Specified by:
getPubSubTopicin classorg.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
-
setDittoHeaders
protected ThingSnapshotTaken setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.json.JsonObject thingJson) - Specified by:
setDittoHeadersin classorg.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
-
getResourceType
-
toJson
public org.eclipse.ditto.json.JsonObject toJson(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, Predicate<org.eclipse.ditto.json.JsonField> predicate) - Specified by:
toJsonin interfaceorg.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,org.eclipse.ditto.json.JsonField> - Overrides:
toJsonin classorg.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
-
equals
- Overrides:
equalsin classorg.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
-
toString
- Overrides:
toStringin classorg.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
-