Class Pair<K,​V>

java.lang.Object
co.elastic.clients.util.Pair<K,​V>

public class Pair<K,​V>
extends java.lang.Object
A key/value pair. Used to represent pairs where the name is not a string (generally an enum).

The key must have a string representation in JSON.

  • Constructor Summary

    Constructors
    Constructor Description
    Pair​(K name, V value)  
  • Method Summary

    Modifier and Type Method Description
    static <K,​ V> JsonpDeserializer<Pair<K,​V>> deserializer​(java.util.function.Function<java.lang.String,​K> keyDeserializer, JsonpDeserializer<V> valueDeserializer)  
    K key()  
    static <K,​ V> Pair<K,​V> of​(K name, V value)  
    V value()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pair

      public Pair​(K name, V value)
  • Method Details

    • key

      public K key()
    • value

      public V value()
    • of

      public static <K,​ V> Pair<K,​V> of​(K name, V value)
    • deserializer

      public static <K,​ V> JsonpDeserializer<Pair<K,​V>> deserializer​(java.util.function.Function<java.lang.String,​K> keyDeserializer, JsonpDeserializer<V> valueDeserializer)