mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-28 08:21:35 +00:00
34 lines
650 B
Java
34 lines
650 B
Java
import lombok.experimental.FieldNameConstants;
|
|
import lombok.AccessLevel;
|
|
|
|
@FieldNameConstants(asEnum = true, innerTypeName = "TypeTest")
|
|
class FieldNameConstantsHandrolled1 {
|
|
int field1, alsoAField, thirdField;
|
|
|
|
public enum TypeTest {
|
|
field1
|
|
}
|
|
}
|
|
|
|
@FieldNameConstants(asEnum = true, innerTypeName = "TypeTest")
|
|
class FieldNameConstantsHandrolled2 {
|
|
int field1, alsoAField, thirdField;
|
|
|
|
public enum TypeTest {
|
|
field1;
|
|
|
|
public String foo() {
|
|
return name();
|
|
}
|
|
}
|
|
}
|
|
|
|
@FieldNameConstants
|
|
class FieldNameConstantsHandrolled3 {
|
|
int field1, alsoAField, thirdField;
|
|
|
|
static class Fields {
|
|
public static final int alsoAField = 5;
|
|
}
|
|
}
|