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 aMapwhere you can add element, but duplicate elements make the values an array. It also supports addingKeyValuePairsas 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 voidadd(String key, Object value)voidadd(String key, Object... values)booleanisEmpty()voidserializeToContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder builder)Serializes the object to a sequence of fields.intsize()StringtoString()
-
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
serializeToContentBuilder
public void serializeToContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder builder) throws IOExceptionSerializes the object to a sequence of fields. The empty object will be serialized asnull.- Throws:
IOException
-
-