Package org.apache.storm.streams

## Class Pair<T1,​T2>

- java.lang.Object
- - org.apache.storm.streams.Pair<T1,​T2>

- All Implemented Interfaces:
    `Serializable`

      public final class Pair<T1,​T2>
      extends Object
      implements Serializable

  A pair of values.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `T1` | `value1` | The first value.
    `T2` | `value2` | The second value.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object o)` |
    `T1` | `getFirst()` | Returns the first value in a pair.
    `T2` | `getSecond()` | Returns the second value in a pair.
    `int` | `hashCode()` |
    `static <T1,​T2> Pair<T1,​T2>` | `of​(T1 first, T2 second)` | Constructs a new pair of values.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### value1

          public final T1 value1

      The first value.

    - #### value2

          public final T2 value2

      The second value.

  - ### Method Detail

    - #### of

          public static <T1,​T2> Pair<T1,​T2> of​(T1 first,
                                                           T2 second)

      Constructs a new pair of values.
      Type Parameters:
        `T1` - the type of the first value
        `T2` - the type of the second value
      Parameters:
        `first` - the first value
        `second` - the second value
      Returns:
        a new pair of values

    - #### getFirst

          public T1 getFirst()

      Returns the first value in a pair.
      Returns:
        the first value

    - #### getSecond

          public T2 getSecond()

      Returns the second value in a pair.
      Returns:
        the second value

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`