Package lombok
Annotation Type val
-
public @interface valUsevalas the type of any local variable declaration (even in a for-each statement), and the type will be inferred from the initializing expression. For example:val x = 10.0;will inferdouble, andval y = new ArrayList<String>();will inferArrayList<String>. The local variable will also be made final.Note that this is an annotation type because
val x = 10;will be desugared to@val final int x = 10;Complete documentation is found at the project lombok features page for @val.