Class JsonObject

    • Constructor Detail

      • JsonObject

        public JsonObject​(java.util.List<JsonPair> pairs)
        Creates new JSON array from given list of pairs.
        Parameters:
        pairs - Pairs to make up the contents of the created JSON object.
      • JsonObject

        public JsonObject​(JsonPair... pairs)
        Creates new JSON array from given list of pairs.
        Parameters:
        pairs - Pairs to make up the contents of the created JSON object.
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface JsonCollection
        Returns:
        true only if this array or object has no elements or pairs, respectively.
      • size

        public int size()
        Specified by:
        size in interface JsonCollection
        Returns:
        The number of elements or pairs in this collection.
      • pairs

        public java.util.List<JsonPair> pairs()
        Returns:
        Object pairs.
      • iterator

        public java.util.Iterator<JsonPair> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<JsonPair>
      • readJson

        public static JsonObject readJson​(BinaryReader source)
                                   throws DtoReadException
        Reads JSON object from given source.
        Parameters:
        source - Source containing JSON object at the current read offset, ignoring any whitespace.
        Returns:
        Decoded JSON object.
        Throws:
        DtoReadException - If the source does not contain a valid JSON object at the current read offset, or if the source could not be read.
      • readJson

        public static JsonObject readJson​(se.arkalix.internal.dto.json.JsonTokenBuffer buffer)
                                   throws DtoReadException
        Internal API. Might change in breaking ways between patch versions of the Kalix library. Use is not advised.
        Throws:
        DtoReadException
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object