From 66f313949726d76953c8afb8f19fdbfb5c5dc986 Mon Sep 17 00:00:00 2001 From: isXander Date: Tue, 15 Aug 2023 16:17:55 +0100 Subject: Deprecate config api v1 --- common/src/main/java/dev/isxander/yacl3/config/ConfigEntry.java | 4 ++++ common/src/main/java/dev/isxander/yacl3/config/ConfigInstance.java | 2 ++ .../src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'common/src/main/java/dev') diff --git a/common/src/main/java/dev/isxander/yacl3/config/ConfigEntry.java b/common/src/main/java/dev/isxander/yacl3/config/ConfigEntry.java index 1af09d4..066cf42 100644 --- a/common/src/main/java/dev/isxander/yacl3/config/ConfigEntry.java +++ b/common/src/main/java/dev/isxander/yacl3/config/ConfigEntry.java @@ -5,6 +5,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/** + * @deprecated Use {@link dev.isxander.yacl3.config.v2.api.SerialEntry} instead. + */ +@Deprecated @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface ConfigEntry { diff --git a/common/src/main/java/dev/isxander/yacl3/config/ConfigInstance.java b/common/src/main/java/dev/isxander/yacl3/config/ConfigInstance.java index e84f6c1..31d4ca2 100644 --- a/common/src/main/java/dev/isxander/yacl3/config/ConfigInstance.java +++ b/common/src/main/java/dev/isxander/yacl3/config/ConfigInstance.java @@ -11,7 +11,9 @@ import java.lang.reflect.InvocationTargetException; * how it saves and load. * * @param config data type + * @deprecated upgrade to config v2 {@link dev.isxander.yacl3.config.v2.api.ConfigClassHandler} */ +@Deprecated public abstract class ConfigInstance { private final Class configClass; private final T defaultInstance; diff --git a/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java b/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java index 32c688c..0d7b289 100644 --- a/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java +++ b/common/src/main/java/dev/isxander/yacl3/config/GsonConfigInstance.java @@ -15,13 +15,15 @@ import java.util.function.UnaryOperator; /** * Uses GSON to serialize and deserialize config data from JSON to a file. - * + *

* Only fields annotated with {@link ConfigEntry} are included in the JSON. * {@link Component}, {@link Style} and {@link Color} have default type adapters, so there is no need to provide them in your GSON instance. * GSON is automatically configured to format fields as {@code lower_camel_case}. * * @param config data type + * @deprecated upgrade to config v2 {@link dev.isxander.yacl3.config.v2.api.ConfigClassHandler} with {@link dev.isxander.yacl3.config.v2.api.serializer.GsonConfigSerializerBuilder} */ +@Deprecated public class GsonConfigInstance extends ConfigInstance { private final Gson gson; private final Path path; -- cgit