Sure -- go ahead. (I'd probably avoid static import, however. One word more, but more readable.)
On Mon, May 16, 2016 at 9:05 AM, Jesse Anderson <[email protected]> wrote: > Does anyone have any thoughts or concerns with me changing the example code > to use the new TypeDescriptors class from the inline creation of a > TypeDescriptor? > > For example, MinimalWordCountJava8 would change from: > > > p.apply(TextIO.Read.from("gs://dataflow-samples/shakespeare/*")) > > .apply(FlatMapElements.via((String word) -> > Arrays.asList(word.split("[^a-zA-Z']+"))) > > .withOutputType(new TypeDescriptor<String>() {})) > > to: > > p.apply(TextIO.Read.from("gs://dataflow-samples/shakespeare/*")) > > .apply(FlatMapElements.via((String word) -> > Arrays.asList(word.split("[^a-zA-Z']+"))) > .withOutputType(strings())) > > I'd use a static import to decrease the code footprint. > > Thanks, > > Jesse >
