Interface PayloadBuilder
-
public interface PayloadBuilder
A builder to createPayload
instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Payload
build()
Creates a newPayload
from the previously set values.PayloadBuilder
withExtra(org.eclipse.ditto.json.JsonObject extra)
Sets the given extra information which enriches the actual value of the payload.PayloadBuilder
withFields(String fields)
Sets the givenfields
to this builder.PayloadBuilder
withFields(org.eclipse.ditto.json.JsonFieldSelector fields)
Sets the givenfields
to this builder.PayloadBuilder
withRevision(long revision)
Sets the givenrevision
to this builder.PayloadBuilder
withStatus(int status)
Sets the givenstatus
to this builder.PayloadBuilder
withStatus(org.eclipse.ditto.model.base.common.HttpStatusCode status)
Sets the givenstatus
to this builder.PayloadBuilder
withTimestamp(Instant timestamp)
Sets the giventimestamp
to this builder.PayloadBuilder
withValue(org.eclipse.ditto.json.JsonValue value)
Sets the givenvalue
to this builder.
-
-
-
Method Detail
-
withValue
PayloadBuilder withValue(@Nullable org.eclipse.ditto.json.JsonValue value)
Sets the givenvalue
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 ornull
.- Returns:
- this builder to allow method chaining.
-
withStatus
PayloadBuilder withStatus(@Nullable org.eclipse.ditto.model.base.common.HttpStatusCode status)
Sets the givenstatus
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 givenstatus
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 givenrevision
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 giventimestamp
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 givenfields
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 givenfields
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 newPayload
from the previously set values.- Returns:
- the payload.
-
-