Java annotation to change null value
Advertisements I want to write an annotation that can change the parameter value to some default if it is null. For example: static void myMethod(@NullToDefault String param) { System.out.println(param); } public static void main(String[] args) { myMethod("foo"); //prints "foo" myMethod(null); //prints "default" } I have separately an annotation and a method to change the null… Read More Java annotation to change null value