Package de.espirit.firstspirit.json
Interface JsonObject
- All Superinterfaces:
- JsonElement<JsonObject>,- de.espirit.firstspirit.json.JsonOutput
The root interface for json objects. Classes that implement this interface can be used as json objects
 within the FirstSpirit json framework.
- Since:
- 5.2.191206
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionstatic JsonObjectcreate()Create a new emptyJsonObject.@Nullable JsonElement<?>Get the value with the specified key.booleanhasAttribute(@NotNull String name) Checks if thisobjectcontains an attribute with the given name.booleanisEmpty()Returnstrueif this json object contains no elements.@NotNull Collection<JsonPair>pairs()This method can be used to get all currently pairs that are part of the object.@NotNull JsonObjectThis method adds one pair to the object.@NotNull JsonObjectput(@NotNull String key, @NotNull JsonElement<?> value) This method adds one pair to the object.@NotNull JsonObjectput(@NotNull Collection<? extends JsonPair> pairs) This methods adds any kind of collection ofJsonPairs to the object.This methods removes the pair with the specified key.This methods removes the pair with the specified key.@Nullable JsonElement<?>Get the value for the specified path.Methods inherited from interface de.espirit.firstspirit.json.JsonElementgetValueMethods inherited from interface de.espirit.firstspirit.json.JsonOutputjson, writeTo
- 
Field Details- 
PREFIXstatic final char PREFIXThe default prefix of an object in json '{'.- Since:
- 5.2.191206
- See Also:
 
- 
DELIMITERstatic final char DELIMITERThe default delimiter of an object in json ','.- Since:
- 5.2.191206
- See Also:
 
- 
SUFFIXstatic final char SUFFIXThe default suffix of an object in json '}'.- Since:
- 5.2.191206
- See Also:
 
 
- 
- 
Method Details- 
createCreate a new emptyJsonObject.- Returns:
- a new JsonObject
- Since:
- 5.2.191206
 
- 
hasAttributeChecks if thisobjectcontains an attribute with the given name.- Parameters:
- name- the name to check
- Returns:
- trueif this attribute is present, otherwise- false
- Since:
- 5.2.191206
 
- 
pairsThis method can be used to get all currently pairs that are part of the object.- Returns:
- The Listof all the pairs.
- Since:
- 5.2.191206
 
- 
putThis method adds one pair to the object.- Parameters:
- pair- The pair that should be added (must not be- null).
- Returns:
- The object itself.
- Since:
- 5.2.191206
 
- 
put@NotNull @NotNull JsonObject put(@NotNull @NotNull String key, @NotNull @NotNull JsonElement<?> value) This method adds one pair to the object.- Parameters:
- key- The key of the pair that should be added.
- value- The value of the pair that should be added.
- Returns:
- The object itself.
- Since:
- 5.2.191206
 
- 
putThis methods adds any kind of collection ofJsonPairs to the object.- Parameters:
- pairs- The pairs that should be added (must not be- null).
- Returns:
- The object itself.
- Since:
- 5.2.191206
 
- 
removeThis methods removes the pair with the specified key.- Parameters:
- key- The key to remove
- Returns:
- The object itself.
- Since:
- 5.2.191206
 
- 
removeThis methods removes the pair with the specified key.- Parameters:
- pair- The Pair to remove
- Returns:
- The object itself.
- Since:
- 5.2.191206
 
- 
getGet the value with the specified key.- Parameters:
- key- The key of the value which is requested.
- Returns:
- The requested value or nullif the key is unknown.
- Since:
- 5.2.191206
 
- 
resolveGet the value for the specified path. E.g. for{ "a" : { "b": { "c": "x" }}}the path "a/b/c" specifies the value "x".- Parameters:
- path- The path of the requested value
- Returns:
- The requested value or nullif any key in the path is unknown.
- Since:
- 5.2.191206
 
- 
isEmptyboolean isEmpty()Returnstrueif this json object contains no elements.- Returns:
- trueif this json object contains no elements, else- false
- Since:
- 5.2.191206
 
 
-