Interface ValueMapperWithKey<K,V,VR>

Type Parameters:
K - key type
V - value type
VR - mapped value type

public interface ValueMapperWithKey<K,V,VR>
The ValueMapperWithKey interface for mapping a value to a new value of arbitrary type. This is a stateless record-by-record operation, i.e, apply(Object, Object) is invoked individually for each record of a stream (cf. ValueTransformer for stateful value transformation). If ValueMapperWithKey is applied to a key-value pair record the record's key is preserved. Note that the key is read-only and should not be modified, as this can lead to corrupt partitioning. If a record's key and value should be modified KeyValueMapper can be used.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(K readOnlyKey, V value)
    Map the given [key and ]value to a new value.
  • Method Details

    • apply

      VR apply(K readOnlyKey, V value)
      Map the given [key and ]value to a new value.
      Parameters:
      readOnlyKey - the read-only key
      value - the value to be mapped
      Returns:
      the new value