Class Tuple<K,V>

java.lang.Object
org.spongepowered.api.util.Tuple<K,V>
Type Parameters:
K - The key
V - The value

public class Tuple<K,V> extends Object
A tuple of objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tuple(K first, V second)
    Creates a new Tuple.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(@Nullable Object obj)
     
    Gets the first object, otherwise known as "key".
    int
     
    static <K, V> Tuple<K,V>
    of(K first, V second)
    Creates a new Tuple with the desired first and second objects.
    Gets the second object, otherwise known as "value".
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Tuple

      public Tuple(K first, V second)
      Creates a new Tuple.
      Parameters:
      first - The first object
      second - The second object
  • Method Details

    • of

      public static <K, V> Tuple<K,V> of(K first, V second)
      Creates a new Tuple with the desired first and second objects.
      Type Parameters:
      K - The type of first object
      V - The type of second object
      Parameters:
      first - The first object
      second - 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 String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object