Package com.github.wnameless.json.base
Interface JsonArrayBase<JVB extends JsonValueBase<JVB>>
- Type Parameters:
JVB- the type of a JSON implementation wrapper
- All Superinterfaces:
Iterable<JVB>,Jsonable,JsonValueBase<JVB>
- All Known Subinterfaces:
JsonArrayCore<JVC>
- All Known Implementing Classes:
GsonJsonArray,JacksonJsonArray,JakartaJsonArray,OrgJsonArray
public interface JsonArrayBase<JVB extends JsonValueBase<JVB>>
extends Iterable<JVB>, JsonValueBase<JVB>
JsonArrayBase extends JsonValueBase and adds essential methods which should be
included in any JSON array implementation.- Author:
- Wei-Ming Wu
-
Method Summary
Modifier and TypeMethodDescriptionget(int index) Returns a JSON value wrapper by given index.default booleanisEmpty()Checks if this JSON array is empty.intsize()Returns the size of this JSON array.stream()Turns this JSON array into a Stream ofJsonValueBase.toList()Converts this JSON array to a JavaList.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
get
Returns a JSON value wrapper by given index.- Parameters:
index- a position in this JSON array- Returns:
- a JSON value wrapper
-
size
int size()Returns the size of this JSON array.- Returns:
- an int
-
isEmpty
default boolean isEmpty()Checks if this JSON array is empty.- Returns:
- true if this JSON array is empty, false otherwise
-
toList
Converts this JSON array to a JavaList.- Returns:
- a
List
-
stream
Turns this JSON array into a Stream ofJsonValueBase.- Returns:
- a
Stream
-