Debian Codegraph @

framework/tests/all-systems/java8inference/Issue3032.java

raw
1 import java.io.Serializable;
2
3 public class Issue3032 {
4 public static class PCollection<T> implements PValue {
5 public <OutputT extends POutput> OutputT apply(
6 String name, PTransform<? super PCollection<T>, OutputT> t) {
7 throw new RuntimeException();
8 }
9 }
10
11 public abstract static class PTransform<InputT extends PInput, OutputT extends POutput> {}
12
13 interface PInput {}
14
15 interface POutput {}
16
17 interface PValue extends PInput, POutput {}
18
19 static class BillingEvent {
20 InvoiceGroupingKey getInvoiceGroupingKey() {
21 throw new RuntimeException();
22 }
23 }
24
25 public static class MapElements<InputT, OutputT>
26 extends PTransform<PCollection<? extends InputT>, PCollection<OutputT>> {
27 public static <InputT, OutputT> MapElements<InputT, OutputT> via(
28 final ProcessFunction<InputT, OutputT> fn) {
29 throw new RuntimeException();
30 }
31 }
32
33 static class InvoiceGroupingKey {}
34
35 @FunctionalInterface
36 public interface ProcessFunction<InputT, OutputT> extends Serializable {
37 OutputT apply(InputT input) throws Exception;
38 }
39
40 private static class GenerateInvoiceRows
41 extends PTransform<PCollection<BillingEvent>, PCollection<String>> {
42 public void expand(PCollection<BillingEvent> input) {
43 input.apply(
44 "Map to invoicing key", MapElements.via(BillingEvent::getInvoiceGroupingKey));
45 }
46 }
47 }