Package org.spongepowered.api.util
Class Tuple<K,V>
- java.lang.Object
-
- org.spongepowered.api.util.Tuple<K,V>
-
- Type Parameters:
K
- The keyV
- The value
public class Tuple<K,V> extends java.lang.Object
A tuple of objects.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(@Nullable java.lang.Object obj)
K
first()
Gets the first object, otherwise known as "key".int
hashCode()
static <K,V>
Tuple<K,V>of(K first, V second)
V
second()
Gets the second object, otherwise known as "value".java.lang.String
toString()
-
-
-
Method Detail
-
of
public static <K,V> Tuple<K,V> of(K first, V second)
- Type Parameters:
K
- The type of first objectV
- The type of second object- Parameters:
first
- The first objectsecond
- The second object- Returns:
- The new Tuple
-
first
public K first()
Gets the first object, otherwise known as "key".- Returns:
- The first object
-
second
public V second()
Gets the second object, otherwise known as "value".- Returns:
- The value
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-