13 Nisan 2021 Salı

Lombok @Value Anotasyonu - Record Gibidir

Giriş
Açıklaması şöyle
@Value is similar to @Data except, all fields are made private and final by default and setters are not generated. These qualities make @Value objects effectively immutable. As the fields are all final, there is not a no argument constructor. Instead Lombok uses @AllArgsConstructor to generate an all arguments constructor. This results in a fully-functioning, effectively-immutable object.
Açıklaması şöyle
 Short for final @ToString, @EqualsAndHashCode, @AllArgsConstructor,   @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE), @Getter.

Hiç yorum yok:

Yorum Gönder