mirror of
https://github.com/HMCore/Core.git
synced 2025-12-13 14:26:22 +00:00
Refactor ObjectInfoData to Kotlin
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
package org.hmcore.registration.config;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
public class ObjectInfoData {
|
|
||||||
|
|
||||||
public final String objectName;
|
|
||||||
public final String objectInfoChosen;
|
|
||||||
public final String _availableOptions;
|
|
||||||
|
|
||||||
public ObjectInfoData(String objectName, @Nullable String objectInfoChosen, String availableOptions) {
|
|
||||||
this.objectName = objectName;
|
|
||||||
this.objectInfoChosen = objectInfoChosen == null ? "default" : objectInfoChosen;
|
|
||||||
_availableOptions = availableOptions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,5 +8,5 @@ import extensions.map
|
|||||||
|
|
||||||
private val GSON = GsonBuilder().setPrettyPrinting().create()
|
private val GSON = GsonBuilder().setPrettyPrinting().create()
|
||||||
|
|
||||||
fun Array<Module<*, *>>.generateFreshJSON(): String =
|
internal fun Array<Module<*, *>>.generateFreshJSON(): String =
|
||||||
GSON.toJson(ObjectInfoConfig(map { ModuleInfo(it.name, it.objectInfoArray) }))
|
GSON.toJson(ObjectInfoConfig(map { ModuleInfo(it.name, it.objectInfoArray) }))
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package org.hmcore.registration.config
|
||||||
|
|
||||||
|
internal class ObjectInfoData @JvmOverloads constructor(
|
||||||
|
@JvmField val objectInfoName: String,
|
||||||
|
@JvmField val availableOptions: String,
|
||||||
|
@JvmField val objectInfoChosen: String = "default",
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user