blob: eb4b1e1b3227ae937bc3c6f60349a780a432b7b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
class GenericMethodArguments {
static class Items<T> {
public <Output extends T> Output apply(Transform<? super Items<T>, Output> t) {
return null;
}
}
static class Transforms {
public static <I, O> Transform<I, O> of(DoFn<I, O> fn) {
return null;
}
}
static class Transform<Input, Output> {}
static class DoFn<Input, Output> {}
static class MyFn1<T> extends DoFn<T, Long> {}
static class MyFn2 extends MyFn1<Integer> {}
private Items<Integer> items;
public void useCase1() {
items.apply(Transforms.of(new MyFn2()));
}
public void useCase2() {
items.apply(Transforms.of(new DoFn<Integer,Long>(){}));
}
}
|