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:
  • Constructor Details

    • 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 Details

    • 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