public class KeyValue<K extends Comparable<? super K>,V extends Comparable<? super V>> extends Object implements Comparable<KeyValue<K,V>>, Serializable
Comparable
holder for key-value pairs.Modifier and Type | Field and Description |
---|---|
K |
key
The key of the key-value pair.
|
V |
value
The value the key-value pair.
|
Constructor and Description |
---|
KeyValue()
Creates a new key-value pair where all fields are null.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(KeyValue<K,V> other) |
boolean |
equals(Object o) |
int |
hashCode() |
static <K extends Comparable<? super K>,T1 extends Comparable<? super T1>> |
of(K key,
T1 value)
Creates a new key-value pair.
|
String |
toString() |
public K extends Comparable<? super K> key
public V extends Comparable<? super V> value
public KeyValue()
public int compareTo(KeyValue<K,V> other)
compareTo
in interface Comparable<KeyValue<K extends Comparable<? super K>,V extends Comparable<? super V>>>
public static <K extends Comparable<? super K>,T1 extends Comparable<? super T1>> KeyValue<K,T1> of(K key, T1 value)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.