Package com.github.wnameless.json.base
Interface JsonObjectBase<JVB extends JsonValueBase<JVB>>
-
- Type Parameters:
JVB- the type of a JSON implementation wrapper
- All Superinterfaces:
Iterable<Map.Entry<String,JVB>>,Jsonable,JsonValueBase<JVB>
- All Known Subinterfaces:
JsonObjectCore<JVC>
- All Known Implementing Classes:
GsonJsonObject,JacksonJsonObject
public interface JsonObjectBase<JVB extends JsonValueBase<JVB>> extends Iterable<Map.Entry<String,JVB>>, JsonValueBase<JVB>
JsonObjectBaseextendsJsonValueBaseand adds essential methods which should be included in any JSON object implementation.- Author:
- Wei-Ming Wu
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancontains(String name)Checks if this JSON object contains given field name.JVBget(String name)Returns a JSON value wrapper by given field name.default booleanisEmpty()Checks if this JSON object is empty.Iterator<String>names()Returns field names of this JSON object.intsize()Returns the size of this JSON object.default Map<String,Object>toMap()Converts this JSON object to a JavaMap.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
names
Iterator<String> names()
Returns field names of this JSON object.- Returns:
- an
Iteratorof field names
-
contains
boolean contains(String name)
Checks if this JSON object contains given field name.- Parameters:
name- a field name- Returns:
- true if this JSON object contains given field name, false otherwise
-
get
JVB get(String name)
Returns a JSON value wrapper by given field name.- Parameters:
name- a field name- Returns:
- a JSON value wrapper
-
size
int size()
Returns the size of this JSON object.- Returns:
- an int
-
isEmpty
default boolean isEmpty()
Checks if this JSON object is empty.- Returns:
- true if this JSON object is empty, false otherwise
-
-