diff options
author | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-07-25 11:58:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 11:58:48 +0100 |
commit | 2159b8d6cc7e0de418062fecb8e57244184e8820 (patch) | |
tree | cb3928cc4f027138319b5a7e16a691785c88d703 /api | |
parent | 580fd1d5c4ec5625c813f6d593928a401a500869 (diff) | |
download | OneConfig-2159b8d6cc7e0de418062fecb8e57244184e8820.tar.gz OneConfig-2159b8d6cc7e0de418062fecb8e57244184e8820.tar.bz2 OneConfig-2159b8d6cc7e0de418062fecb8e57244184e8820.zip |
additional config migrators (#64)
* json migrator
* *coughs*
* casting issues fix
* cfg implementation and a couple fixes
* reformat
* cast fix + javadoc
* make the json migrator useful, double parsing, separate annotations
Diffstat (limited to 'api')
-rw-r--r-- | api/OneConfig.api | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/api/OneConfig.api b/api/OneConfig.api index b7ecd78..c9c7ae3 100644 --- a/api/OneConfig.api +++ b/api/OneConfig.api @@ -338,6 +338,33 @@ public class cc/polyfrost/oneconfig/config/gson/ProfileExclusionStrategy : cc/po public fun shouldSkipField (Lcom/google/gson/FieldAttributes;)Z } +public class cc/polyfrost/oneconfig/config/migration/CfgMigrator : cc/polyfrost/oneconfig/config/migration/Migrator { + public fun <init> (Ljava/lang/String;)V + protected fun generateValues ()V + public fun getValue (Ljava/lang/reflect/Field;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; + protected fun parse (Ljava/lang/String;)Ljava/lang/String; +} + +public abstract interface annotation class cc/polyfrost/oneconfig/config/migration/CfgName : java/lang/annotation/Annotation { + public abstract fun category ()Ljava/lang/String; + public abstract fun name ()Ljava/lang/String; +} + +public class cc/polyfrost/oneconfig/config/migration/JsonMigrator : cc/polyfrost/oneconfig/config/migration/Migrator { + protected field object Lcom/google/gson/JsonObject; + protected field values Ljava/util/HashMap; + public fun <init> (Ljava/lang/String;)V + protected fun generateValues ()V + public fun getValue (Ljava/lang/reflect/Field;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; + protected fun loopThroughChildren (Ljava/lang/String;Lcom/google/gson/JsonObject;)V + protected fun parse (Ljava/lang/String;)Ljava/lang/String; + protected fun put (Ljava/lang/String;Lcom/google/gson/JsonElement;)V +} + +public abstract interface annotation class cc/polyfrost/oneconfig/config/migration/JsonName : java/lang/annotation/Annotation { + public abstract fun value ()Ljava/lang/String; +} + public abstract interface class cc/polyfrost/oneconfig/config/migration/Migrator { public abstract fun getValue (Ljava/lang/reflect/Field;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; } @@ -347,7 +374,7 @@ public class cc/polyfrost/oneconfig/config/migration/VigilanceMigrator : cc/poly protected final field filePath Ljava/lang/String; protected field values Ljava/util/HashMap; public fun <init> (Ljava/lang/String;)V - protected fun getOptions ()V + protected fun generateValues ()V public fun getValue (Ljava/lang/reflect/Field;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; protected fun parse (Ljava/lang/String;)Ljava/lang/String; } |