blob: 7adc402adac781a6c9b66ddb656eea628f280419 (
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
34
35
|
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Delegate;
import lombok.val;
import java.util.function.Function;
public class ValDelegateMethodReference {
public void config() {
val column = createColumn(Entity::getValue);
}
private <V> Column<Entity, V> createColumn(Function<Entity, V> func) {
return new Column<>(func);
}
}
class Column<T, V> {
public Column(Function<T, V> vp) {}
}
class Entity {
@Delegate
private MyDelegate innerDelegate;
}
@Getter
@Setter
class MyDelegate {
private String value;
private Boolean aBoolean;
}
|