Class JsonArray


  • @Internal
    public class JsonArray
    extends JsonNode
    Public to allow special handling for conversion service. Use JsonNode.isArray() to distinguish nodes.
    Since:
    3.1
    • Method Detail

      • size

        public int size()
        Specified by:
        size in class JsonNode
        Returns:
        The number of immediate children of this node, or 0 if this is not a container node.
      • isArray

        public boolean isArray()
        Overrides:
        isArray in class JsonNode
        Returns:
        true iff this node is an array node.
      • get

        public JsonNode get​(@NonNull
                            java.lang.String fieldName)
        Specified by:
        get in class JsonNode
        Parameters:
        fieldName - The field name.
        Returns:
        The field with the given name, or null if there is no such field or this is not an object.
      • get

        public JsonNode get​(int index)
        Specified by:
        get in class JsonNode
        Parameters:
        index - The index into this array.
        Returns:
        The field at the given index, or null if there is no such field or this is not an array.
      • values

        @NonNull
        public java.lang.Iterable<JsonNode> values()
        Specified by:
        values in class JsonNode
        Returns:
        An Iterable of all values of this array or object node.
      • entries

        @NonNull
        public java.lang.Iterable<java.util.Map.Entry<java.lang.String,​JsonNode>> entries()
        Specified by:
        entries in class JsonNode
        Returns:
        An Iterable of all entries of this object node.
      • equals

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

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

        public boolean isContainerNode()
        Overrides:
        isContainerNode in class JsonNode
        Returns:
        true iff this node is a container node (array or object).