Class ThingSnapshotTaken.Builder

java.lang.Object
org.eclipse.ditto.things.api.ThingSnapshotTaken.Builder
Enclosing class:
ThingSnapshotTaken

@NotThreadSafe public static final class ThingSnapshotTaken.Builder extends Object
A mutable builder with a fluent API for creating instances of ThingSnapshotTaken. By default the builder sets the timestamp of the event to Instant.now() and empty DittoHeaders. Both properties can be overwritten by calling the appropriate setter methods.
  • Method Details

    • policyId

      public ThingSnapshotTaken.Builder policyId(@Nullable org.eclipse.ditto.policies.model.PolicyId policyId)
      Sets the specified policy ID.
      Parameters:
      policyId - the policy ID to be set or null if the event has none (default).
      Returns:
      this builder instance.
    • timestamp

      public ThingSnapshotTaken.Builder timestamp(@Nullable Instant timestamp)
      Sets the timestamp when the snapshot was taken. By default the timestamp is set to Instant.now().
      Parameters:
      timestamp - the timestamp to be set or null if the event does not have a timestamp at all.
      Returns:
      this builder instance.
    • metadata

      public ThingSnapshotTaken.Builder metadata(@Nullable org.eclipse.ditto.base.model.entity.metadata.Metadata metadata)
      Sets the specified metadata.
      Parameters:
      metadata - the metadata to be set or null if the event has none (default).
      Returns:
      this builder instance.
    • dittoHeaders

      public ThingSnapshotTaken.Builder dittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Sets the specified DittoHeaders. By default empty headers are set.
      Parameters:
      dittoHeaders - the headers to be set.
      Returns:
      this builder instance.
      Throws:
      NullPointerException - if dittoHeaders is null.
    • build

      public ThingSnapshotTaken build()
      Constructs a new ThingSnapshotTaken instance.
      Returns:
      the ThingSnapshotTaken instance.