Created
July 14, 2012 07:37
-
-
Save kiris/3109868 to your computer and use it in GitHub Desktop.
lombok @ExtensionMethod sample2.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.experimental.ExtensionMethod; | |
@ExtensionMethod({ Extensions1.class, Extensions2.class }) | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println("test".addedMethod()); // => "test added method 1" | |
} | |
} | |
class Extensions1 { | |
public static String addedMethod(String value) { | |
return value + " added method 1"; | |
} | |
} | |
class Extensions2 { | |
public static String addedMethod(String value) { | |
return value + " added method 2"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment