728x90 lombok9 Lombok features - @Cleanup @Cleanup Automatic resource management: Call your close() methods safely with no hassle. Overview You can use @Cleanup to ensure a given resource is automatically cleaned up before the code execution path exits your current scope. You do this by annotating any local variable declaration with the @Cleanup annotation like so: @Cleanup InputStream in = new FileInputStream("some/file"); As a result,.. 2020. 12. 9. Lombok features - @NonNull @NonNull or: How I learned to stop worrying and love the NullPointerException. @NonNull was introduced in lombok v0.11.10. Overview You can use @NonNull on the parameter of a method or constructor to have lombok generate a null-check statement for you. Lombok has always treated various annotations generally named @NonNull on a field as a signal to generate a null-check if lombok generates an ent.. 2020. 12. 9. Lombok features - val & var val Finally! Hassle-free final local variables. val was introduced in lombok 0.10. Overview You can use val as the type of a local variable declaration instead of actually writing the type. When you do this, the type will be inferred from the initializer expression. The local variable will also be made final. This feature works on local variables and on foreach loops only, not on fields. The ini.. 2020. 12. 9. 이전 1 2 다음 728x90