From c7bfba873eb62a73668875cb1e9d94fb322bec1c Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Thu, 1 May 2014 21:42:38 +0200 Subject: [java8] Support in delombok for method references. --- test/pretty/resource/before/MethodReference.java | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/pretty/resource/before/MethodReference.java (limited to 'test/pretty/resource/before') diff --git a/test/pretty/resource/before/MethodReference.java b/test/pretty/resource/before/MethodReference.java new file mode 100644 index 00000000..c7af9bf3 --- /dev/null +++ b/test/pretty/resource/before/MethodReference.java @@ -0,0 +1,48 @@ +// version 8: +class MethodReference { + public MethodReference() { + } + + public MethodReference(T in) { + } + + public void simpleInstanceReference() { + Runnable r = this::foo; + } + + public void simpleConstructorReference() { + Runnable r = MethodReference::new; + } + + public void simpleStaticReference() { + Runnable r = MethodReference::staticFoo; + } + + public void generifiedStaticReference() { + StringConverter sc = MethodReference::generifiedStaticFoo; + } + + public void generifiedConstructorReference() { + FooConverter fc = MethodReference::new; + } + + public void foo() { + } + + private static void staticFoo() { + } + + public static T generifiedStaticFoo(T foo) { + return foo; + } + + @FunctionalInterface + public interface StringConverter { + public String hello(String x); + } + + @FunctionalInterface + public interface FooConverter { + public K hello(String x); + } +} -- cgit