Class JsonArray

java.lang.Object
io.micronaut.json.tree.JsonNode
io.micronaut.json.tree.JsonArray

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

    • getValue

      public Object getValue()
      Description copied from class: JsonNode
      Get the value reprinting this node.
      Specified by:
      getValue in class JsonNode
      Returns:
      The value of the node
    • 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 @NonNull 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 @NonNull Iterable<JsonNode> values()
      Specified by:
      values in class JsonNode
      Returns:
      An Iterable of all values of this array or object node.
    • entries

      Specified by:
      entries in class JsonNode
      Returns:
      An Iterable of all entries of this object node.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

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