Interface PayloadBuilder


  • public interface PayloadBuilder
    A builder to create Payload instances.
    • Method Detail

      • withValue

        PayloadBuilder withValue​(@Nullable
                                 org.eclipse.ditto.json.JsonValue value)
        Sets the given value to this builder. A previously set value is replaced.
        Parameters:
        value - the value to set.
        Returns:
        this builder to allow method chaining.
      • withExtra

        PayloadBuilder withExtra​(@Nullable
                                 org.eclipse.ditto.json.JsonObject extra)
        Sets the given extra information which enriches the actual value of the payload. Previously set extra is replaced.
        Parameters:
        extra - the extra payload information or null.
        Returns:
        this builder to allow method chaining.
      • withStatus

        PayloadBuilder withStatus​(@Nullable
                                  org.eclipse.ditto.model.base.common.HttpStatusCode status)
        Sets the given status to this builder. A previously set status is replaced.
        Parameters:
        status - the status to set.
        Returns:
        this builder to allow method chaining.
      • withStatus

        PayloadBuilder withStatus​(int status)
        Sets the given status to this builder. A previously set status is replaced.
        Parameters:
        status - the status to set.
        Returns:
        this builder to allow method chaining.
      • withRevision

        PayloadBuilder withRevision​(long revision)
        Sets the given revision to this builder. A previously set revision is replaced.
        Parameters:
        revision - the revision to set.
        Returns:
        this builder to allow method chaining.
      • withTimestamp

        PayloadBuilder withTimestamp​(@Nullable
                                     Instant timestamp)
        Sets the given timestamp to this builder. A previously set timestamp is replaced.
        Parameters:
        timestamp - the timestamp to set.
        Returns:
        this builder to allow method chaining.
      • withFields

        PayloadBuilder withFields​(@Nullable
                                  org.eclipse.ditto.json.JsonFieldSelector fields)
        Sets the given fields to this builder. Previously set fields are replaced.
        Parameters:
        fields - the fields to set.
        Returns:
        this builder to allow method chaining.
      • withFields

        PayloadBuilder withFields​(@Nullable
                                  String fields)
        Sets the given fields to this builder. Previously set fields are replaced.
        Parameters:
        fields - the fields to set.
        Returns:
        this builder to allow method chaining.
      • build

        Payload build()
        Creates a new Payload from the previously set values.
        Returns:
        the payload.