com.google.cloud.dataflow.sdk.values

## Class KV<K,V>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.values.KV<K,V>

Type Parameters:
  `K` - the type of the key
  `V` - the type of the value

All Implemented Interfaces:
  Serializable

    public class KV<K,V>
    extends Object
    implements Serializable

An immutable key/value pair.

Various `PTransforms` like `GroupByKey` and `Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)` operate on `PCollections` of `KVs`.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `KV.OrderByKey<K extends Comparable<? super K>,V>` A `Comparator` that orders `KVs` by the natural ordering of their keys.
`static class` `KV.OrderByValue<K,V extends Comparable<? super V>>` A `Comparator` that orders `KVs` by the natural ordering of their values.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals(Object other)`
`K` `getKey()` Returns the key of this `KV`.
`V` `getValue()` Returns the value of this `KV`.
`int` `hashCode()`
`static <K,V> KV<K,V>` `of(K key, V value)` Returns a `KV` with the given key and value.
`String` `toString()`

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

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

### Method Detail

#### of

    public static <K,V> KV<K,V> of(K key,
                                   V value)

Returns a `KV` with the given key and value.

#### getKey

    public K getKey()

Returns the key of this `KV`.

#### getValue

    public V getValue()

Returns the value of this `KV`.

#### equals

    public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`