rework config annotations a bit

This commit is contained in:
FalsePattern committed 2022-05-07 01:33:04 +02:00
1 parent d21a1d3012
commit dc62f9d986
2 files changed
+42 -27

No files matched your search

@@ -42,6 +42,12 @@ public @interface Config {
@Target(ElementType.FIELD)
@interface Ignore {}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface DefaultBoolean {
boolean value();
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface RangeInt {
@@ -53,21 +59,33 @@ public @interface Config {
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface DefaultInt {
int value() default 0;
int value();
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface RangeDouble {
double min() default Double.MIN_VALUE;
@interface RangeFloat {
float min() default Float.MIN_VALUE;
double max() default Double.MAX_VALUE;
float max() default Float.MAX_VALUE;
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface DefaultDouble {
double value() default 0d;
@interface DefaultFloat {
float value();
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface DefaultString {
String value();
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface Pattern {
String value();
}
@Retention(RetentionPolicy.RUNTIME)