Class JsonArray

    • Constructor Detail

      • JsonArray

        public JsonArray​(java.util.List<JsonValue> elements)
        Creates new JSON array from given list of elements.
        Parameters:
        elements - Elements to make up the contents of the created JSON array.
      • JsonArray

        public JsonArray​(JsonValue... elements)
        Creates new JSON array from given list of elements.
        Parameters:
        elements - Elements to make up the contents of the created JSON array.
    • 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.
      • elements

        public java.util.List<JsonValue> elements()
        Returns:
        Array elements.
      • iterator

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

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

        public static JsonArray 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