Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using lombok with Spring

Tags:

spring

lombok

I want to know if is possible to use Lombok with Spring, because in my project I got stack trace because I didn´t have a getter or setter method, but I put @getter and @setter annotations in my code.

@Data
public class EmailBean {

    @Getter @Setter
    private String contato;
    @Getter @Setter
    private String contatoCopia;
    @Getter @Setter
    private String copiaOculta;
    @Getter @Setter
    private String titulo;
    @Getter @Setter
    private String mensagem;

    @Getter @Setter
    private List<Contato> listaContatosSelecionados;
    @Getter @Setter
    private Set<String> setEmails;

    @Getter @Setter
    private boolean mostrar;

    @Getter @Setter
    private EmailHelper helper;
    @Getter @Setter
    private EmailFilter filter;

    public boolean mostrarListener() {
        this.mostrar = true;
        return this.mostrar;
    }
}

So anyone, can help me?

like image 598
Diego Macario Avatar asked Oct 02 '22 18:10

Diego Macario


1 Answers

You probably need to override canEquals. See http://projectlombok.org/features/EqualsAndHashCode.html for more information.

like image 58
Roel Spilker Avatar answered Oct 07 '22 04:10

Roel Spilker