Class Pair<K,V>
java.lang.Object
javafx.util.Pair<K,V>
- Type Parameters:
-
K- the key (name) type -
V- the value type
- All Implemented Interfaces:
Serializable
public class Pair<K,V> extends Object implements Serializable
A convenience class to represent name-value pairs.
- Since:
- JavaFX 2.0
- See Also:
Constructor Summary
| Constructor | Description |
|---|---|
Pair |
Creates a new pair |
Method Summary
Constructor Details
Pair
public Pair(K key, V value)
Creates a new pair
- Parameters:
-
key- The key for this pair -
value- The value to use for this pair
Method Details
getKey
public K getKey()
Gets the key for this pair.
- Returns:
- key for this pair
getValue
public V getValue()
Gets the value for this pair.
- Returns:
- value for this pair
toString
hashCode
equals
public boolean equals(Object o)
Test this Pair for equality with another Object.
If the Object to be tested is not a Pair or is null, then this method returns false.
Two Pairs are considered equal if and only if both the names and values are equal.
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.