diff options
author | isXander <xander@isxander.dev> | 2023-08-15 16:17:55 +0100 |
---|---|---|
committer | isXander <xander@isxander.dev> | 2023-08-15 16:17:55 +0100 |
commit | 66f313949726d76953c8afb8f19fdbfb5c5dc986 (patch) | |
tree | 0ea71cad809efab07b955970bc4fd082d80cf25a /common/src/main/java/dev | |
parent | 9f72a09a5b2afc99b08a79bda84f91ef51c0f4d0 (diff) | |
download | YetAnotherConfigLib-66f313949726d76953c8afb8f19fdbfb5c5dc986.tar.gz YetAnotherConfigLib-66f313949726d76953c8afb8f19fdbfb5c5dc986.tar.bz2 YetAnotherConfigLib-66f313949726d76953c8afb8f19fdbfb5c5dc986.zip |
Deprecate config api v1
Diffstat (limited to 'common/src/main/java/dev')
3 files changed, 9 insertions, 1 deletions
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 <T> config data type + * @deprecated upgrade to config v2 {@link dev.isxander.yacl3.config.v2.api.ConfigClassHandler} */ +@Deprecated public abstract class ConfigInstance<T> { private final Class<T> 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. - * + * <p> * 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 <T> 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<T> extends ConfigInstance<T> { private final Gson gson; private final Path path; |