- java.lang.Object
-
- org.arakhne.afc.vmutil.json.JsonBuffer
-
public class JsonBuffer extends Object
Basic Json buffer.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:35
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- vmutils
-
-
Constructor Summary
Constructors Constructor Description JsonBuffer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String name, Iterable<?> value)Add the given value.voidadd(String name, Object value)Add the given value.voidadd(String name, Map<?,?> value)Add the given value.voidadd(String name, JsonBuffer value)Add the given value.voidclear()Remove all the keys.booleanisEmpty()Replies if the buffer is empty or not.voidretainAll(String... keys)Keep the specified keys into the Json and remove the other keys.StringtoString()static StringtoString(String name, Object value, Object... otherPairs)Build the Json string representation of the given pairs.static StringtoString(JsonableObject value)Build the Json string representation of the given value.
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Replies if the buffer is empty or not.- Returns:
trueif the buffer is empty.falseif the buffer is not empty.- Since:
- 15.0
-
add
public void add(String name, Object value)
Add the given value.- Parameters:
name- the name.value- the value.
-
add
public void add(String name, Iterable<?> value)
Add the given value.- Parameters:
name- the name.value- the value.
-
add
public void add(String name, Map<?,?> value)
Add the given value.- Parameters:
name- the name.value- the value.
-
add
public void add(String name, JsonBuffer value)
Add the given value.- Parameters:
name- the name.value- the value.
-
retainAll
public void retainAll(String... keys)
Keep the specified keys into the Json and remove the other keys.- Parameters:
keys- the names of the keys.- Since:
- 16.0
-
clear
public void clear()
Remove all the keys.- Since:
- 16.0
-
toString
public static String toString(String name, Object value, Object... otherPairs)
Build the Json string representation of the given pairs.- Parameters:
name- the name of the first attribute.value- the value of the first attribute.otherPairs- the other pairs.- Returns:
- the string representation.
-
toString
public static String toString(JsonableObject value)
Build the Json string representation of the given value.- Parameters:
value- the value of the first attribute.- Returns:
- the string representation.
- Since:
- 15.0
-
-