aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/experimental/FieldNameConstants.java
diff options
context:
space:
mode:
authorPhilippe Charles <charphi@users.noreply.github.com>2018-08-22 09:54:00 +0200
committerGitHub <noreply@github.com>2018-08-22 09:54:00 +0200
commit3ffac6642456e2c7d32952c62df8a565e2d4728b (patch)
treeb0a28ac208dcb8af9add494c4caffe4f11bb287b /src/core/lombok/experimental/FieldNameConstants.java
parent35c7c6bda2e71da2e6e06cec5b0fb012c348f694 (diff)
parent769185e123dfd4a073161eafb58ce50bb79d6201 (diff)
downloadlombok-3ffac6642456e2c7d32952c62df8a565e2d4728b.tar.gz
lombok-3ffac6642456e2c7d32952c62df8a565e2d4728b.tar.bz2
lombok-3ffac6642456e2c7d32952c62df8a565e2d4728b.zip
Merge branch 'master' into master
Diffstat (limited to 'src/core/lombok/experimental/FieldNameConstants.java')
-rw-r--r--src/core/lombok/experimental/FieldNameConstants.java28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/core/lombok/experimental/FieldNameConstants.java b/src/core/lombok/experimental/FieldNameConstants.java
index 31c2970c..d6886890 100644
--- a/src/core/lombok/experimental/FieldNameConstants.java
+++ b/src/core/lombok/experimental/FieldNameConstants.java
@@ -29,12 +29,32 @@ import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
- * Generates String constants containing the field name for each field.
+ * Generates an inner type, containing String constants containing the field name for each field. Alternatively, generates an inner enum with enum values matching each field name.
*/
-@Target({ElementType.TYPE, ElementType.FIELD})
+@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface FieldNameConstants {
lombok.AccessLevel level() default AccessLevel.PUBLIC;
- String prefix() default " CONFIG DEFAULT ";
- String suffix() default " CONFIG DEFAULT ";
+ boolean asEnum() default false;
+ String innerTypeName() default "";
+
+ /**
+ * Only include fields and methods explicitly marked with {@code @FieldNameConstants.Include}.
+ * Normally, all (non-static) fields are included by default.
+ */
+ boolean onlyExplicitlyIncluded() default false;
+
+ /**
+ * If present, do not include this field in the generated fieldnames inner type.
+ */
+ @Target(ElementType.FIELD)
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Exclude {}
+
+ /**
+ * If present, include this field in the generated fieldnames inner type (default).
+ */
+ @Target(ElementType.FIELD)
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Include {}
}