Açıklaması şöyle
Örnek@UtilityClass annotation which creates a private constructor that throws an exception, makes the class final, and makes all methods static.
Şöyle yaparız
@UtilityClass// will be made finalpublic class UtilityClass {// will be made staticprivate final int GRUBHUB = “ GRUBHUB”;// autogenerated by Lombok// private UtilityClass() {// throw new java.lang.UnsupportedOperationException("... cannot be instantiated");//}// will be made staticpublic void append(String input) {return input + GRUBHUB;}}
Hiç yorum yok:
Yorum Gönder