Is it possible with additional configuration etc to have both @Value
and @NoArgsConstructor
on a pojo. Something like below.
@Value
@NoArgsConstructor
public class TestClass implements Serializable {
private String x;
private String y;
private String z;
}
For the above class intelij gives compilation error - Variable 'x', 'y', 'z' might not have been initialized
etc.
I will appreciate if you can give a working pojo as example.
Work Arounds -
I know i can use something like below as a work around-
@NoArgsConstructor @AllArgsConstructor @Getter public class TestClass implements Serializable {
private String x; private String y; private String z; }
I need the @NoArgsConstructor as jackson needs it. I could find other ways to handle immutable classes with jackson - 1 and 2. But would still prefer to handle it through lombok if it's possible.