1

It has been a long time since I haven't written any Java and I get pretty confused with the <String, Integer> in the following line (from the following documentation):

static class ComputeWordLengthFn extends DoFn<String, Integer> { ... }

I am not even sure that it is the generics concept that occurs here.

What should I understand regarding String and Integer here?

Documentation for DoFn: here

Manuel RODRIGUEZ
  • 2,131
  • 3
  • 25
  • 53
  • What is `DoFn`? – Andy Turner Mar 16 '18 at 16:27
  • Give the `DoFn` definition if you want a explaining about that. – davidxxx Mar 16 '18 at 16:27
  • Assuming you're looking at [this](https://beam.apache.org/documentation/programming-guide/) (and, btw, it helps if you say what it is you are reading), `String` is the input type to a function and `Integer` is the result type. But in general, these could mean absolutely anything. – Andy Turner Mar 16 '18 at 16:29
  • @AndyTurner I just updated my post to provide documentation. You seem to be right indeed, input and output. How is this annotation called? This isn't generics right? – Manuel RODRIGUEZ Mar 16 '18 at 16:36

0 Answers0