Class JsonList
- All Implemented Interfaces:
JsonBaseNode, JsonListNode, JsonPart, Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess, SequencedCollection<Object>
To parse json array string:
JsonListNode jsonList = JsonList.parse("[1, 4, 0, 1]");
//To get the value from an index
int intValueAt1 = jsonList.getValueAsInteger(1);
System.out.println("intValueAt1 = " + intValueAt1); // intValueAt1 = 4
//Prints the json string
System.out.println("toJsonString = " + jsonList.toJsonString()); // toJsonString = [1,4,0,1]
- Since:
- 12.0.4
- See Also:
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAllMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface JsonBaseNode
toOutputStreamMethods inherited from interface JsonListNode
getValueAsBigDecimal, getValueAsBigInteger, getValueAsDouble, getValueAsInteger, getValueAsJsonListNode, getValueAsJsonMapNode, getValueAsLong, getValueAsString, toBigJsonString, toJsonString, toOutputStream, toWffBMArrayMethods inherited from interface List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
JsonList
public JsonList(int initialCapacity) -
JsonList
public JsonList() -
JsonList
-
-
Method Details
-
parse
-
toString
- Overrides:
toStringin classAbstractCollection<Object>
-