-
public final class OrderedJsonMap
-
-
Constructor Summary
Constructors Constructor Description OrderedJsonMap(List<Pair<String, JsonValue>> pairs)
-
Method Summary
Modifier and Type Method Description final List<Pair<String, JsonValue>>getPairs()The ordered key/value pairs (insertion order), sanitized for JSON validity. final IntegergetCount()final BooleangetIsEmpty()final List<String>getKeys()final JsonValueget(String key)Key lookup (first match in insertion order). final <T extends Any> List<T>map(Function1<Pair<String, JsonValue>, T> transform)Maps each pair; convenience so callers can read order, e.g. final JsonValuetoJsonObject()The pairs as a JsonObject node. Booleanequals(Object other)IntegerhashCode()-
-
Method Detail
-
getPairs
final List<Pair<String, JsonValue>> getPairs()
The ordered key/value pairs (insertion order), sanitized for JSON validity.
-
getIsEmpty
final Boolean getIsEmpty()
-
get
final JsonValue get(String key)
Key lookup (first match in insertion order). null for missing keys.
-
map
final <T extends Any> List<T> map(Function1<Pair<String, JsonValue>, T> transform)
Maps each pair; convenience so callers can read order, e.g.
.map { it.first }.
-
toJsonObject
final JsonValue toJsonObject()
The pairs as a JsonObject node.
-
-
-
-