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

57 lines
1.5 KiB
Java
Raw Normal View History

2021-09-27 20:55:48 +02:00
package io.gitlab.jfronny.libjf.config.test;
2021-04-11 20:23:52 +02:00
import io.gitlab.jfronny.commons.serialize.gson.api.Ignore;
2022-03-30 23:08:51 +02:00
import io.gitlab.jfronny.libjf.config.api.*;
2021-04-11 20:23:52 +02:00
2022-04-04 20:03:10 +02:00
import java.util.ArrayList;
import java.util.List;
2021-09-27 20:55:48 +02:00
public class TestConfig implements JfConfig {
@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 = -6) public static float floatTest = -5;
@Entry(max = 21) public static double doubleTest = 20;
2021-05-29 10:37:13 +02:00
@Entry public static String dieStr = "lolz";
@Entry @Ignore
2022-04-29 15:48:27 +02:00
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
}