Methref
Simple way
Methref.of(Str.class).name(Str::boo);
// returns String: 'boo' Methref.of(Str.class).name((str) -> str.hello(null, 0));
// returns 'hello'Separate way
Methref m = Methref.of(Str.class);
// get proxy
Str str = m.proxy();
// invoke method
str.foo();
// get invoked method name
String name = m.lastName();Detect Methref
Where this can be used?
Last updated