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 Link icon

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

    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 Link icon

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

    • Tuple Link icon

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

    • of Link icon

      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 Link icon

      public K first()
      Gets the first object, otherwise known as "key".
      Returns:
      The first object
    • second Link icon

      public V second()
      Gets the second object, otherwise known as "value".
      Returns:
      The value
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • hashCode Link icon

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

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