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,JakartaJsonObject,OrgJsonObject
public interface JsonObjectBase<JVB extends JsonValueBase<JVB>>
extends Iterable<Map.Entry<String,JVB>>, JsonValueBase<JVB>
JsonObjectBase extends JsonValueBase and adds essential methods which should be
included in any JSON object implementation.- Author:
- Wei-Ming Wu
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this JSON object contains given field name.Returns a JSON value wrapper by given field name.default booleanisEmpty()Checks if this JSON object is empty.names()Returns field names of this JSON object.intsize()Returns the size of this JSON object.stream()Turns this JSON object into a Stream of Entry<String,JsonValueBase>.toMap()Converts this JSON object to a JavaMap.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
contains
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
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
-
names
Returns field names of this JSON object.- Returns:
- an
Iteratorof field names
-
isEmpty
default boolean isEmpty()Checks if this JSON object is empty.- Returns:
- true if this JSON object is empty, false otherwise
-
toMap
Converts this JSON object to a JavaMap.- Returns:
- a
Map
-
stream
Turns this JSON object into a Stream of Entry<String,JsonValueBase>.- Returns:
- a
Stream
-