Package com.benesult.vivjson
Class Viv.KeyValue<T>
java.lang.Object
com.benesult.vivjson.Viv.KeyValue<T>
- Enclosing class:
Viv
Key-Value pair data class.
Mostly, this will be elements of the array.
Then it is used to represent HashMap.
For example,
// {"a": 10, "b": 20}
String code = "{\"a\": 10, \"b\": 20}";
try {
Object object = Viv.runEx(code);
Viv.KeyValue<Integer>[] pairs = Viv.getKeyValueIntegersEx(object);
for (Viv.KeyValue<Integer> pair : pairs) {
System.out.println(pair.key + ": " + pair.value);
}
} catch (VivException e) {
System.err.println(e.getMessage());
}
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
key
Key of key-value pair. It is so called Name. -
value
Value of key-value pair. Its value type is generic. It is assumed that Boolean, Integer, Long, Float, Double, or String.
In addition,@Nullable
may be added.
-
-
Constructor Details
-
KeyValue
-