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 Classes
    Modifier and Type
    Class
    Description
    static final class 
    A mutable builder with a fluent API for creating instances of ThingSnapshotTaken.

    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.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>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Pub-sub topic of this event.

    Fields inherited from interface org.eclipse.ditto.base.model.signals.events.Event

    DEFAULT_REVISION, TYPE_QUALIFIER
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Deserializes a ThingSnapshotTaken instance from the specified JSON object.
    org.eclipse.ditto.things.model.ThingId
     
    Optional<org.eclipse.ditto.policies.model.PolicyId>
    Gets the policy ID associated with the thing for which the snapshot was taken.
     
     
    int
     
    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 a ThingSnapshotTaken.
    setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.json.JsonObject thingJson)
     
    org.eclipse.ditto.json.JsonObject
    toJson(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, Predicate<org.eclipse.ditto.json.JsonField> predicate)
     
     

    Methods inherited from class org.eclipse.ditto.base.api.persistence.SnapshotTaken

    getDittoHeaders, getEntity, getLifecycle, getManifest, getMetadata, getPersistenceLifecycle, getResourcePath, getRevision, getTimestamp, getType, setDittoHeaders

    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, toJson

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

    getEntity
  • Field Details

  • 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 a ThingSnapshotTaken.
      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 is null.
    • fromJson

      public static ThingSnapshotTaken fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Deserializes a ThingSnapshotTaken instance 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 is null.
      org.eclipse.ditto.json.JsonMissingFieldException - – if jsonObject did not contain all required fields.
      org.eclipse.ditto.json.JsonParseException - if jsonObject does not represent a valid ThingSnapshotTaken.
    • getPolicyId

      public Optional<org.eclipse.ditto.policies.model.PolicyId> 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:
      getEntityId in interface org.eclipse.ditto.base.model.entity.id.WithEntityId
      Specified by:
      getEntityId in class org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
    • getPubSubTopic

      public String getPubSubTopic()
      Specified by:
      getPubSubTopic in class org.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:
      setDittoHeaders in class org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
    • getResourceType

      public String 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:
      toJson in interface org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,org.eclipse.ditto.json.JsonField>
      Overrides:
      toJson in class org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>
    • toString

      public String toString()
      Overrides:
      toString in class org.eclipse.ditto.base.api.persistence.SnapshotTaken<ThingSnapshotTaken>