Class StreamAck

  • All Implemented Interfaces:
    org.eclipse.ditto.model.base.json.Jsonifiable

    @Immutable
    public final class StreamAck
    extends Object
    implements org.eclipse.ditto.model.base.json.Jsonifiable
    Ack message that is used for acking elements while streaming.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  StreamAck.Status
      Status of ACKs.
      • 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 Detail

      • success

        public static StreamAck success​(String elementId)
        Create an successful ack.
        Parameters:
        elementId - the element for which the ack is sent.
        Returns:
        The StreamAck with status StreamAck.Status.SUCCESS.
      • failure

        public static StreamAck failure​(String elementId)
        Create an failure ack.
        Parameters:
        elementId - the element for which the ack is sent.}.
        Returns:
        The StreamAck with status StreamAck.Status.FAILURE.
      • toJson

        public org.eclipse.ditto.json.JsonValue toJson()
        Specified by:
        toJson in interface org.eclipse.ditto.model.base.json.Jsonifiable
      • fromJson

        public static StreamAck fromJson​(org.eclipse.ditto.json.JsonObject jsonObject)
        Creates a new StreamAck from a JSON object.
        Parameters:
        jsonObject - the JSON object of which a new StreamAck is to be created.
        Returns:
        the StreamAck which was created from the given JSON object.
        Throws:
        NullPointerException - if jsonObject is null.
        IllegalArgumentException - if jsonObject is empty.
        org.eclipse.ditto.json.JsonParseException - if the passed in jsonObject is not valid JSON.
        org.eclipse.ditto.json.JsonMissingFieldException - if the passed in jsonObject was not in the expected 'StreamAck' format.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object