Interface Payload
-
- All Superinterfaces:
org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
public interface Payload extends org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
Represents thePayload
of anAdaptable
. The Ditto Protocol defines that aPayload
must always have apath
property.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Payload.JsonFields
Json Fields of the Jsonifiable Payload.-
Nested classes/interfaces inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable
org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends Object>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<org.eclipse.ditto.json.JsonObject>
getExtra()
Returns the extra information which enriches the actual value of this payload.Optional<org.eclipse.ditto.json.JsonFieldSelector>
getFields()
Returns thefields
of thisPayload
if present.MessagePath
getPath()
Returns thepath
of thisPayload
.Optional<Long>
getRevision()
Returns therevision
of thisPayload
if present.Optional<org.eclipse.ditto.model.base.common.HttpStatusCode>
getStatus()
Returns thestatus
of thisPayload
if present.Optional<Instant>
getTimestamp()
Returns thetimestamp
of thisPayload
if present.Optional<org.eclipse.ditto.json.JsonValue>
getValue()
Returns thevalue
of thisPayload
if present.static PayloadBuilder
newBuilder()
Returns a mutable builder to create immutablePayload
without apath
.static PayloadBuilder
newBuilder(org.eclipse.ditto.json.JsonPointer path)
Returns a mutable builder to create immutablePayload
instances for a givenpath
.static PayloadBuilder
newBuilder(Payload payload)
Returns a mutable builder with a fluent API for creating a Payload.
-
-
-
Method Detail
-
newBuilder
static PayloadBuilder newBuilder(org.eclipse.ditto.json.JsonPointer path)
Returns a mutable builder to create immutablePayload
instances for a givenpath
.- Parameters:
path
- the path.- Returns:
- the builder.
- Throws:
NullPointerException
- ifpath
isnull
.
-
newBuilder
static PayloadBuilder newBuilder()
Returns a mutable builder to create immutablePayload
without apath
.- Returns:
- the builder.
-
newBuilder
static PayloadBuilder newBuilder(Payload payload)
Returns a mutable builder with a fluent API for creating a Payload. The returned builder is initialised with the values of the given payload.- Parameters:
payload
- provides the initial properties of the returned builder.- Returns:
- the builder.
- Throws:
NullPointerException
- ifpayload
isnull
.
-
getPath
MessagePath getPath()
Returns thepath
of thisPayload
.- Returns:
- the path.
-
getValue
Optional<org.eclipse.ditto.json.JsonValue> getValue()
Returns thevalue
of thisPayload
if present.- Returns:
- the optional value.
-
getExtra
Optional<org.eclipse.ditto.json.JsonObject> getExtra()
Returns the extra information which enriches the actual value of this payload.- Returns:
- the extra payload or an empty Optional.
-
getStatus
Optional<org.eclipse.ditto.model.base.common.HttpStatusCode> getStatus()
Returns thestatus
of thisPayload
if present.- Returns:
- the optional status.
-
getRevision
Optional<Long> getRevision()
Returns therevision
of thisPayload
if present.- Returns:
- the optional revision.
-
getTimestamp
Optional<Instant> getTimestamp()
Returns thetimestamp
of thisPayload
if present.- Returns:
- the optional timestamp.
-
getFields
Optional<org.eclipse.ditto.json.JsonFieldSelector> getFields()
Returns thefields
of thisPayload
if present.- Returns:
- the optional fields.
-
-