Package de.pangaea.metadataportal.utils
Class KeyValuePairs
- java.lang.Object
-
- de.pangaea.metadataportal.utils.KeyValuePairs
-
public final class KeyValuePairs extends Object
Key/Value pairs used to build JSON. This behaves like aMap
where you can add element, but duplicate elements make the values an array. It also supports addingKeyValuePairs
as value, in which case an object is created in the resulting JSON.
-
-
Constructor Summary
Constructors Constructor Description KeyValuePairs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(String key, Object value)
void
add(String key, Object... values)
boolean
isEmpty()
void
serializeToContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder builder)
Serializes the object to a sequence of fields.int
size()
String
toString()
-
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
serializeToContentBuilder
public void serializeToContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder builder) throws IOException
Serializes the object to a sequence of fields. The empty object will be serialized asnull
.- Throws:
IOException
-
-