mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-03 07:13:15 +00:00
@Value's final-by-default and private-by-default with it; now appropriate warnings are emitted) * Builder now errors out on presence of most lombok annotations on an explicit builder class. * Builder now takes @FieldDefaults/@Value into account. * Builder on type now generates the constructor as package private instead of private to avoid synthetic accessor constructors. * added a bunch of test cases. * added a test case feature: If the expected file is omitted entirely but there are expected messages, the differences in the output itself are ignored. * streamlined checking for boolean-ness (removed some duplicate code) * added 'fluent' and 'chain' to @Builder.
31 lines
888 B
Java
31 lines
888 B
Java
class BuilderChainAndFluent {
|
|
private final int yes;
|
|
@java.lang.SuppressWarnings("all")
|
|
BuilderChainAndFluent(final int yes) {
|
|
this.yes = yes;
|
|
}
|
|
@java.lang.SuppressWarnings("all")
|
|
public static class BuilderChainAndFluentBuilder {
|
|
private int yes;
|
|
@java.lang.SuppressWarnings("all")
|
|
BuilderChainAndFluentBuilder() {
|
|
}
|
|
@java.lang.SuppressWarnings("all")
|
|
public void setYes(final int yes) {
|
|
this.yes = yes;
|
|
}
|
|
@java.lang.SuppressWarnings("all")
|
|
public BuilderChainAndFluent build() {
|
|
return new BuilderChainAndFluent(yes);
|
|
}
|
|
@java.lang.Override
|
|
@java.lang.SuppressWarnings("all")
|
|
public java.lang.String toString() {
|
|
return "BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes + ")";
|
|
}
|
|
}
|
|
@java.lang.SuppressWarnings("all")
|
|
public static BuilderChainAndFluentBuilder builder() {
|
|
return new BuilderChainAndFluentBuilder();
|
|
}
|
|
} |