mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-06 20:15:58 +00:00
#1976. A handlers' order has been changed. The javac's HandleDelegate generates code before the HandleVal.
This commit is contained in:
1 parent
150be0a186
commit
ce0a09177e
5 files changed
+162
-2
No files matched your search
@@ -0,0 +1,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;
|
||||
}
|
||||
Reference in new issue
Block a user