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 the Payload of an Adaptable. The Ditto Protocol defines that a Payload must always have a path 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 the fields of this Payload if present.
      MessagePath getPath()
      Returns the path of this Payload.
      Optional<Long> getRevision()
      Returns the revision of this Payload if present.
      Optional<org.eclipse.ditto.model.base.common.HttpStatusCode> getStatus()
      Returns the status of this Payload if present.
      Optional<Instant> getTimestamp()
      Returns the timestamp of this Payload if present.
      Optional<org.eclipse.ditto.json.JsonValue> getValue()
      Returns the value of this Payload if present.
      static PayloadBuilder newBuilder()
      Returns a mutable builder to create immutable Payload without a path.
      static PayloadBuilder newBuilder​(org.eclipse.ditto.json.JsonPointer path)
      Returns a mutable builder to create immutable Payload instances for a given path.
      static PayloadBuilder newBuilder​(Payload payload)
      Returns a mutable builder with a fluent API for creating a Payload.
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable

        getImplementedSchemaVersion, getLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJson, toJsonString
    • Method Detail

      • newBuilder

        static PayloadBuilder newBuilder​(org.eclipse.ditto.json.JsonPointer path)
        Returns a mutable builder to create immutable Payload instances for a given path.
        Parameters:
        path - the path.
        Returns:
        the builder.
        Throws:
        NullPointerException - if path is null.
      • newBuilder

        static PayloadBuilder newBuilder()
        Returns a mutable builder to create immutable Payload without a path.
        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 - if payload is null.
      • getPath

        MessagePath getPath()
        Returns the path of this Payload.
        Returns:
        the path.
      • getValue

        Optional<org.eclipse.ditto.json.JsonValue> getValue()
        Returns the value of this Payload 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 the status of this Payload if present.
        Returns:
        the optional status.
      • getRevision

        Optional<Long> getRevision()
        Returns the revision of this Payload if present.
        Returns:
        the optional revision.
      • getTimestamp

        Optional<Instant> getTimestamp()
        Returns the timestamp of this Payload if present.
        Returns:
        the optional timestamp.
      • getFields

        Optional<org.eclipse.ditto.json.JsonFieldSelector> getFields()
        Returns the fields of this Payload if present.
        Returns:
        the optional fields.