Package org.apache.storm.streams.operations.mappers

## Class PairValueMapper<K,​V>

- java.lang.Object
- - org.apache.storm.streams.operations.mappers.PairValueMapper<K,​V>

- Type Parameters:
    `K` - the key type
    `V` - the value type
  All Implemented Interfaces:
    `Serializable`, `Function<Tuple,​Pair<K,​V>>`, `TupleValueMapper<Pair<K,​V>>`, `Operation`, `PairFunction<Tuple,​K,​V>`

      public class PairValueMapper<K,​V>
      extends Object
      implements TupleValueMapper<Pair<K,​V>>, PairFunction<Tuple,​K,​V>

  Extracts a typed key-value pair from a tuple.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PairValueMapper​(int keyIndex, int valueIndex)` | Constructs a new `PairValueMapper` that constructs a pair from a tuple based on the key and value index.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Pair<K,​V>` | `apply​(Tuple input)` | Applies this function to the given argument.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PairValueMapper

          public PairValueMapper​(int keyIndex,
                                 int valueIndex)

      Constructs a new `PairValueMapper` that constructs a pair from a tuple based on the key and value index.
      Parameters:
        `keyIndex` - the key index
        `valueIndex` - the value index

  - ### Method Detail

    - #### apply

          public Pair<K,​V> apply​(Tuple input)

      Description copied from interface: `Function`
      Applies this function to the given argument.
      Specified by:
        `apply` in interface `Function<K,​V>`
      Parameters:
        `input` - the input to the function
      Returns:
        the function result