LibJF/libjf-config-reflect-v1/src/testmod/java/io/gitlab/jfronny/libjf/config/test/reflect/TestConfig.java

58 lines
1.7 KiB
Java
Raw Normal View History

2022-08-22 00:12:19 +02:00
package io.gitlab.jfronny.libjf.config.test.reflect;
2021-04-11 20:23:52 +02:00
2023-03-11 18:06:51 +01:00
import io.gitlab.jfronny.commons.serialize.gson.api.v1.Ignore;
import io.gitlab.jfronny.libjf.config.api.v1.*;
2021-04-11 20:23:52 +02:00
2022-04-04 20:03:10 +02:00
import java.util.ArrayList;
import java.util.List;
2023-07-18 17:23:40 +02:00
@JfConfig(referencedConfigs = {"libjf-web-v0"}, tweaker = TestConfigTweaker.class)
public class TestConfig {
2023-03-11 18:06:51 +01:00
@Entry public static boolean disablePacks = false;
@Entry public static Boolean disablePacks2 = false;
2021-05-29 10:37:13 +02:00
@Entry public static int intTest = 20;
@Entry(min = -5, max = 12) public static int intTestB = 20;
@Entry(min = -6) public static float floatTest = -5;
@Entry(min = 2, max = 21) public static double doubleTest = 20;
2021-05-29 10:37:13 +02:00
@Entry public static String dieStr = "lolz";
2023-03-11 18:06:51 +01:00
@Entry @Ignore public static String guiOnlyStr = "lolz";
2021-05-29 10:37:13 +02:00
public static String gsonOnlyStr = "lolz";
@Entry public static Test enumTest = Test.Test;
2022-04-04 20:03:10 +02:00
@Entry public static List<String> stringList;
2021-04-11 20:23:52 +02:00
2022-01-08 20:02:15 +01:00
@Preset
public static void moskau() {
disablePacks = true;
disablePacks2 = true;
intTest = -5;
floatTest = -6;
doubleTest = 4;
dieStr = "Moskau";
}
@Verifier
public static void setIntTestIfDisable() {
if (disablePacks) intTest = 0;
}
2022-04-04 20:03:10 +02:00
@Verifier
public static void stringListVerifier() {
if (stringList == null) stringList = new ArrayList<>(List.of("Obama"));
}
2021-04-11 20:23:52 +02:00
public enum Test {
Test, ER
}
2022-03-30 23:08:51 +02:00
@Category
public static class Subcategory {
@Entry public static boolean boolInSub = false;
@Entry public static int intIbSub = 15;
@Category
public static class Inception {
@Entry public static Test yesEnum = Test.ER;
}
}
2021-04-11 20:23:52 +02:00
}