Class KeyValuePairs

  • public final class KeyValuePairs
    extends Object
    Key/Value pairs used to build JSON. This behaves like a Map where you can add element, but duplicate elements make the values an array. It also supports adding KeyValuePairs as value, in which case an object is created in the resulting JSON.
    • Constructor Detail

      • KeyValuePairs

        public KeyValuePairs()
    • 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 as null.
      • toString

        public String toString()

        This should be used for debugging only!

        toString in class Object