K - Key type.V - Value type.public class Pair<K,V> extends Object implements Serializable
| Constructor and Description |
|---|
Pair(K k,
V v)
Create an entry representing a mapping from the specified key to the
specified value.
|
Pair(Pair<? extends K,? extends V> entry)
Create an entry representing the same mapping as the specified entry.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
K |
getFirst()
Getter for the first element of the pair.
|
K |
getKey()
Getter for the key.
|
V |
getSecond()
Getter for the second element of the pair.
|
V |
getValue()
Getter for the value.
|
int |
hashCode() |
String |
toString()
Display the key and the value of the pair.
|
public Pair(K k, V v)
k - Key (first element of the pair)v - Value (second element of the pair)public K getKey()
public V getValue()
public K getFirst()
public V getSecond()
Copyright © 2024 CNES. All rights reserved.