Skip to content

Instantly share code, notes, and snippets.

@mafulafunk
Created April 29, 2022 12:11
Show Gist options
  • Save mafulafunk/de23a9822a2ed059573abf28a80c5905 to your computer and use it in GitHub Desktop.
Save mafulafunk/de23a9822a2ed059573abf28a80c5905 to your computer and use it in GitHub Desktop.
KoffeeKlub
package ch_015;
import java.time.LocalDate;
import java.util.function.Function;
import java.util.function.Supplier;
public class SuppliFication {
public static void main(String[] args) {
Function<MySupplier, String> foo = MySupplier::get;
System.out.println(foo.get());
}
}
class GoImpl implements GoSupplieIt<String>{
@Override
public String goGetIt() {
return "null; " + LocalDate.now();
}
}
@FunctionalInterface
interface GoSupplieIt<T> {
T goGetIt();
}
class MySupplier implements Supplier<String>{
@Override
public String get() {
return "My DateNow : " + LocalDate.now();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment