How can I generate both standard accessors and fluent accessors with lombok?

Unfortunately this is impossible. You need to implement own getters and setters, and add @Getter @Setter and @Accessors(fluent = true) annotaions to achieve this.

@Getter
@Setter
@Accessors(fluent = true)
public class SampleClass {
    private int id;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}

In result you will have class like:

public class SampleClass {
    private int id;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int id(){
        return id;
    }

    public SampleClass id(int id){
        this.id=id;
        return this;
    }
}

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.