Class Pair<K,V>
- javafx.util.Pair<K,V>
All Implemented Interfaces:
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
Constructors Constructor and Description Pair(K key, V value)Creates a new pair
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description booleanequals(Object o)Test thisPairfor equality with anotherObject.KgetKey()Gets the key for this pair.VgetValue()Gets the value for this pair.inthashCode()Generate a hash code for thisPair.StringtoString()Stringrepresentation of thisPair.
-
Constructor Detail
-
Pair
public Pair(K key, V value)Creates a new pairParameters:
key- The key for this pair
-
-
Method Detail
-
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
public String toString()
Stringrepresentation of thisPair.The default name/value delimiter '=' is always used.
-
hashCode
public int hashCode()
Generate a hash code for this
Pair.The hash code is calculated using both the name and the value of the
Pair.
-
equals
public boolean equals(Object o)
Test this
Pairfor equality with anotherObject.If the
Objectto be tested is not aPairor isnull, then this method returnsfalse.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.