mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 22:16:11 +00:00
[feature] FieldNameConstants now works like Builder: Make whatever bits it does by hand and lombok fills in whatever is missing.
This commit is contained in:
1 parent
21878e253e
commit
2fd46a50b6
13 files changed
+237
-68
No files matched your search
@@ -0,0 +1,59 @@
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import lombok.AccessLevel;
|
||||
@FieldNameConstants(asEnum = true,innerTypeName = "TypeTest") class FieldNameConstantsHandrolled1 {
|
||||
public enum TypeTest {
|
||||
field1(),
|
||||
alsoAField(),
|
||||
thirdField(),
|
||||
<clinit>() {
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") TypeTest() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
int field1;
|
||||
int alsoAField;
|
||||
int thirdField;
|
||||
FieldNameConstantsHandrolled1() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@FieldNameConstants(asEnum = true,innerTypeName = "TypeTest") class FieldNameConstantsHandrolled2 {
|
||||
public enum TypeTest {
|
||||
field1(),
|
||||
alsoAField(),
|
||||
thirdField(),
|
||||
<clinit>() {
|
||||
}
|
||||
public String foo() {
|
||||
return name();
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") TypeTest() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
int field1;
|
||||
int alsoAField;
|
||||
int thirdField;
|
||||
FieldNameConstantsHandrolled2() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@FieldNameConstants class FieldNameConstantsHandrolled3 {
|
||||
static class Fields {
|
||||
public static final java.lang.String field1 = "field1";
|
||||
public static final java.lang.String thirdField = "thirdField";
|
||||
public static final int alsoAField = 5;
|
||||
<clinit>() {
|
||||
}
|
||||
private @java.lang.SuppressWarnings("all") Fields() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
int field1;
|
||||
int alsoAField;
|
||||
int thirdField;
|
||||
FieldNameConstantsHandrolled3() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user