com.google.cloud.dataflow.examples

## Class WordCount.CountWords

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.PTransform<PCollection<String>,PCollection<KV<String,Long>>>
  - - com.google.cloud.dataflow.examples.WordCount.CountWords

All Implemented Interfaces:
  HasDisplayData, Serializable

Enclosing class:
  WordCount

    public static class WordCount.CountWords
    extends PTransform<PCollection<String>,PCollection<KV<String,Long>>>

A PTransform that converts a PCollection containing lines of text into a PCollection of formatted word counts.

Concept #3: This is a custom composite transform that bundles two transforms (ParDo and Count) as a reusable PTransform subclass. Using composite transforms allows for easy reuse, modular testing, and an improved monitoring experience.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform

`name`

### Constructor Summary

Constructors
Constructor and Description
`CountWords()`

### Method Summary

All Methods Instance Methods Concrete Methods
`PCollection<KV<String,Long>>` `apply(PCollection<String> lines)`

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.PTransform

`getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toString, validate`

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

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

### Constructor Detail

#### CountWords

    public CountWords()

### Method Detail

#### apply

    public PCollection<KV<String,Long>> apply(PCollection<String> lines)

Overrides:
  `apply` in class `PTransform<PCollection<String>,PCollection<KV<String,Long>>>`