mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Improve codegen
This commit is contained in:
parent
e1f2b2e947
commit
3c36bb7660
@ -57,11 +57,13 @@ fun genAllValueImpl(): String = buildString {
|
||||
// PRIMITIVE
|
||||
for (number in NUMBERS + OTHER_PRIMITIVES) {
|
||||
appendln(genValueImpl(number, number, "$number.serializer()", false))
|
||||
appendln()
|
||||
}
|
||||
|
||||
// PRIMITIVE ARRAYS
|
||||
for (number in NUMBERS + OTHER_PRIMITIVES.filterNot { it == "String" }) {
|
||||
appendln(genValueImpl("${number}Array", "${number}Array", "${number}ArraySerializer()", true))
|
||||
appendln()
|
||||
}
|
||||
|
||||
// TYPED ARRAYS
|
||||
@ -74,6 +76,7 @@ fun genAllValueImpl(): String = buildString {
|
||||
true
|
||||
)
|
||||
)
|
||||
appendln()
|
||||
}
|
||||
|
||||
// PRIMITIVE LISTS / SETS
|
||||
@ -87,6 +90,7 @@ fun genAllValueImpl(): String = buildString {
|
||||
false
|
||||
)
|
||||
)
|
||||
appendln()
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,6 +141,40 @@ fun genAllValueImpl(): String = buildString {
|
||||
appendln()
|
||||
}
|
||||
}
|
||||
|
||||
appendln()
|
||||
|
||||
|
||||
appendln(
|
||||
"""
|
||||
internal fun <T : Setting> Setting.valueImpl(default: T): Value<T> {
|
||||
return object : SettingValue<T>() {
|
||||
private var internalValue: T = default
|
||||
override var value: T
|
||||
get() = internalValue
|
||||
set(new) {
|
||||
if (new != internalValue) {
|
||||
internalValue = new
|
||||
onElementChanged(this)
|
||||
}
|
||||
}
|
||||
override val serializer = object : KSerializer<T>{
|
||||
override val descriptor: SerialDescriptor
|
||||
get() = internalValue.updaterSerializer.descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): T {
|
||||
internalValue.updaterSerializer.deserialize(decoder)
|
||||
return internalValue
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: T) {
|
||||
internalValue.updaterSerializer.serialize(encoder, SettingSerializerMark)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
fun genValueImpl(kotlinTypeName: String, miraiValueName: String, serializer: String, isArray: Boolean): String =
|
||||
|
@ -65,10 +65,7 @@ fun genPublicApi() = buildString {
|
||||
"""
|
||||
package net.mamoe.mirai.console.setting
|
||||
|
||||
import kotlinx.serialization.Decoder
|
||||
import kotlinx.serialization.Encoder
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.SerialDescriptor
|
||||
import kotlin.properties.ReadWriteProperty
|
||||
import kotlin.reflect.KProperty
|
||||
"""
|
||||
@ -221,42 +218,11 @@ sealed class Value<T : Any> : ReadWriteProperty<Setting, T> {
|
||||
appendln()
|
||||
}
|
||||
|
||||
// FOR COMPLEX TYPES
|
||||
// SETTING VALUE
|
||||
|
||||
appendln(
|
||||
"""
|
||||
abstract class SettingValue<T : Setting> internal constructor() : Value<T>()
|
||||
|
||||
internal fun <T : Setting> Setting.valueImpl(default: T): Value<T> {
|
||||
return object : SettingValue<T>() {
|
||||
private var internalValue: T = default
|
||||
override var value: T
|
||||
get() = internalValue
|
||||
set(new) {
|
||||
if (new != internalValue) {
|
||||
internalValue = new
|
||||
onElementChanged(this)
|
||||
}
|
||||
}
|
||||
override val serializer = object : KSerializer<T>{
|
||||
override val descriptor: SerialDescriptor
|
||||
get() = internalValue.updaterSerializer.descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): T {
|
||||
internalValue.updaterSerializer.deserialize(decoder)
|
||||
return internalValue
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: T) {
|
||||
internalValue.updaterSerializer.serialize(encoder, SettingSerializerMark)
|
||||
}
|
||||
|
||||
}.bind(
|
||||
getter = { internalValue },
|
||||
setter = { internalValue = it }
|
||||
)
|
||||
}
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
|
@ -9,10 +9,7 @@
|
||||
|
||||
package net.mamoe.mirai.console.setting
|
||||
|
||||
import kotlinx.serialization.Decoder
|
||||
import kotlinx.serialization.Encoder
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.SerialDescriptor
|
||||
import kotlin.properties.ReadWriteProperty
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
@ -65,29 +62,36 @@ sealed class PrimitiveArrayValue<T : Any> : ArrayValue<T>()
|
||||
abstract class IntArrayValue internal constructor() : PrimitiveArrayValue<IntArray>(), Iterable<Int> {
|
||||
override fun iterator(): Iterator<Int> = this.value.iterator()
|
||||
}
|
||||
|
||||
abstract class ShortArrayValue internal constructor() : PrimitiveArrayValue<ShortArray>(), Iterable<Short> {
|
||||
override fun iterator(): Iterator<Short> = this.value.iterator()
|
||||
}
|
||||
|
||||
abstract class ByteArrayValue internal constructor() : PrimitiveArrayValue<ByteArray>(), Iterable<Byte> {
|
||||
override fun iterator(): Iterator<Byte> = this.value.iterator()
|
||||
}
|
||||
|
||||
abstract class LongArrayValue internal constructor() : PrimitiveArrayValue<LongArray>(), Iterable<Long> {
|
||||
override fun iterator(): Iterator<Long> = this.value.iterator()
|
||||
}
|
||||
|
||||
abstract class FloatArrayValue internal constructor() : PrimitiveArrayValue<FloatArray>(), Iterable<Float> {
|
||||
override fun iterator(): Iterator<Float> = this.value.iterator()
|
||||
}
|
||||
|
||||
abstract class DoubleArrayValue internal constructor() : PrimitiveArrayValue<DoubleArray>(), Iterable<Double> {
|
||||
override fun iterator(): Iterator<Double> = this.value.iterator()
|
||||
}
|
||||
|
||||
abstract class BooleanArrayValue internal constructor() : PrimitiveArrayValue<BooleanArray>(), Iterable<Boolean> {
|
||||
override fun iterator(): Iterator<Boolean> = this.value.iterator()
|
||||
}
|
||||
|
||||
abstract class CharArrayValue internal constructor() : PrimitiveArrayValue<CharArray>(), Iterable<Char> {
|
||||
override fun iterator(): Iterator<Char> = this.value.iterator()
|
||||
}
|
||||
|
||||
sealed class TypedPrimitiveArrayValue<E> : ArrayValue<Array<E>>() , Iterable<E>{
|
||||
sealed class TypedPrimitiveArrayValue<E> : ArrayValue<Array<E>>(), Iterable<E> {
|
||||
override fun iterator() = this.value.iterator()
|
||||
}
|
||||
|
||||
@ -101,7 +105,7 @@ abstract class TypedBooleanArrayValue internal constructor() : TypedPrimitiveArr
|
||||
abstract class TypedCharArrayValue internal constructor() : TypedPrimitiveArrayValue<Char>()
|
||||
abstract class TypedStringArrayValue internal constructor() : TypedPrimitiveArrayValue<String>()
|
||||
|
||||
sealed class ListValue<E> : Value<List<E>>(), Iterable<E>{
|
||||
sealed class ListValue<E> : Value<List<E>>(), Iterable<E> {
|
||||
override fun iterator() = this.value.iterator()
|
||||
}
|
||||
|
||||
@ -135,37 +139,6 @@ abstract class SettingSetValue<T : Setting> internal constructor() : Value<Set<T
|
||||
|
||||
abstract class SettingValue<T : Setting> internal constructor() : Value<T>()
|
||||
|
||||
internal fun <T : Setting> Setting.valueImpl(default: T): Value<T> {
|
||||
return object : SettingValue<T>() {
|
||||
private var internalValue: T = default
|
||||
override var value: T
|
||||
get() = internalValue
|
||||
set(new) {
|
||||
if (new != internalValue) {
|
||||
internalValue = new
|
||||
onElementChanged(this)
|
||||
}
|
||||
}
|
||||
override val serializer = object : KSerializer<T> {
|
||||
override val descriptor: SerialDescriptor
|
||||
get() = internalValue.updaterSerializer.descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): T {
|
||||
internalValue.updaterSerializer.deserialize(decoder)
|
||||
return internalValue
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: T) {
|
||||
internalValue.updaterSerializer.serialize(encoder, SettingSerializerMark)
|
||||
}
|
||||
|
||||
}.bind(
|
||||
getter = { internalValue },
|
||||
setter = { internalValue = it }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
abstract class MutableListValue<T : Any> internal constructor() : Value<MutableList<Value<T>>>(), MutableList<T>
|
||||
|
||||
abstract class MutableIntListValue internal constructor() : Value<MutableList<Int>>(), MutableList<Int>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Copyright 2020 Mamoe Technologies and contributors.
|
||||
*
|
||||
@ -38,6 +37,7 @@ internal fun Setting.valueImpl(default: Int): IntValue {
|
||||
override val serializer = Int.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Short): ShortValue {
|
||||
return object : ShortValue() {
|
||||
private var internalValue: Short = default
|
||||
@ -52,6 +52,7 @@ internal fun Setting.valueImpl(default: Short): ShortValue {
|
||||
override val serializer = Short.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Byte): ByteValue {
|
||||
return object : ByteValue() {
|
||||
private var internalValue: Byte = default
|
||||
@ -66,6 +67,7 @@ internal fun Setting.valueImpl(default: Byte): ByteValue {
|
||||
override val serializer = Byte.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Long): LongValue {
|
||||
return object : LongValue() {
|
||||
private var internalValue: Long = default
|
||||
@ -80,6 +82,7 @@ internal fun Setting.valueImpl(default: Long): LongValue {
|
||||
override val serializer = Long.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Float): FloatValue {
|
||||
return object : FloatValue() {
|
||||
private var internalValue: Float = default
|
||||
@ -94,6 +97,7 @@ internal fun Setting.valueImpl(default: Float): FloatValue {
|
||||
override val serializer = Float.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Double): DoubleValue {
|
||||
return object : DoubleValue() {
|
||||
private var internalValue: Double = default
|
||||
@ -108,6 +112,7 @@ internal fun Setting.valueImpl(default: Double): DoubleValue {
|
||||
override val serializer = Double.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Boolean): BooleanValue {
|
||||
return object : BooleanValue() {
|
||||
private var internalValue: Boolean = default
|
||||
@ -122,6 +127,7 @@ internal fun Setting.valueImpl(default: Boolean): BooleanValue {
|
||||
override val serializer = Boolean.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Char): CharValue {
|
||||
return object : CharValue() {
|
||||
private var internalValue: Char = default
|
||||
@ -136,6 +142,7 @@ internal fun Setting.valueImpl(default: Char): CharValue {
|
||||
override val serializer = Char.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: String): StringValue {
|
||||
return object : StringValue() {
|
||||
private var internalValue: String = default
|
||||
@ -150,6 +157,7 @@ internal fun Setting.valueImpl(default: String): StringValue {
|
||||
override val serializer = String.serializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: IntArray): IntArrayValue {
|
||||
return object : IntArrayValue() {
|
||||
private var internalValue: IntArray = default
|
||||
@ -164,6 +172,7 @@ internal fun Setting.valueImpl(default: IntArray): IntArrayValue {
|
||||
override val serializer = IntArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: ShortArray): ShortArrayValue {
|
||||
return object : ShortArrayValue() {
|
||||
private var internalValue: ShortArray = default
|
||||
@ -178,6 +187,7 @@ internal fun Setting.valueImpl(default: ShortArray): ShortArrayValue {
|
||||
override val serializer = ShortArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: ByteArray): ByteArrayValue {
|
||||
return object : ByteArrayValue() {
|
||||
private var internalValue: ByteArray = default
|
||||
@ -192,6 +202,7 @@ internal fun Setting.valueImpl(default: ByteArray): ByteArrayValue {
|
||||
override val serializer = ByteArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: LongArray): LongArrayValue {
|
||||
return object : LongArrayValue() {
|
||||
private var internalValue: LongArray = default
|
||||
@ -206,6 +217,7 @@ internal fun Setting.valueImpl(default: LongArray): LongArrayValue {
|
||||
override val serializer = LongArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: FloatArray): FloatArrayValue {
|
||||
return object : FloatArrayValue() {
|
||||
private var internalValue: FloatArray = default
|
||||
@ -220,6 +232,7 @@ internal fun Setting.valueImpl(default: FloatArray): FloatArrayValue {
|
||||
override val serializer = FloatArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: DoubleArray): DoubleArrayValue {
|
||||
return object : DoubleArrayValue() {
|
||||
private var internalValue: DoubleArray = default
|
||||
@ -234,6 +247,7 @@ internal fun Setting.valueImpl(default: DoubleArray): DoubleArrayValue {
|
||||
override val serializer = DoubleArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: BooleanArray): BooleanArrayValue {
|
||||
return object : BooleanArrayValue() {
|
||||
private var internalValue: BooleanArray = default
|
||||
@ -248,6 +262,7 @@ internal fun Setting.valueImpl(default: BooleanArray): BooleanArrayValue {
|
||||
override val serializer = BooleanArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: CharArray): CharArrayValue {
|
||||
return object : CharArrayValue() {
|
||||
private var internalValue: CharArray = default
|
||||
@ -262,6 +277,7 @@ internal fun Setting.valueImpl(default: CharArray): CharArrayValue {
|
||||
override val serializer = CharArraySerializer()
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Int>): TypedIntArrayValue {
|
||||
return object : TypedIntArrayValue() {
|
||||
private var internalValue: Array<Int> = default
|
||||
@ -276,6 +292,7 @@ internal fun Setting.valueImpl(default: Array<Int>): TypedIntArrayValue {
|
||||
override val serializer = ArraySerializer(Int.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Short>): TypedShortArrayValue {
|
||||
return object : TypedShortArrayValue() {
|
||||
private var internalValue: Array<Short> = default
|
||||
@ -290,6 +307,7 @@ internal fun Setting.valueImpl(default: Array<Short>): TypedShortArrayValue {
|
||||
override val serializer = ArraySerializer(Short.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Byte>): TypedByteArrayValue {
|
||||
return object : TypedByteArrayValue() {
|
||||
private var internalValue: Array<Byte> = default
|
||||
@ -304,6 +322,7 @@ internal fun Setting.valueImpl(default: Array<Byte>): TypedByteArrayValue {
|
||||
override val serializer = ArraySerializer(Byte.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Long>): TypedLongArrayValue {
|
||||
return object : TypedLongArrayValue() {
|
||||
private var internalValue: Array<Long> = default
|
||||
@ -318,6 +337,7 @@ internal fun Setting.valueImpl(default: Array<Long>): TypedLongArrayValue {
|
||||
override val serializer = ArraySerializer(Long.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Float>): TypedFloatArrayValue {
|
||||
return object : TypedFloatArrayValue() {
|
||||
private var internalValue: Array<Float> = default
|
||||
@ -332,6 +352,7 @@ internal fun Setting.valueImpl(default: Array<Float>): TypedFloatArrayValue {
|
||||
override val serializer = ArraySerializer(Float.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Double>): TypedDoubleArrayValue {
|
||||
return object : TypedDoubleArrayValue() {
|
||||
private var internalValue: Array<Double> = default
|
||||
@ -346,6 +367,7 @@ internal fun Setting.valueImpl(default: Array<Double>): TypedDoubleArrayValue {
|
||||
override val serializer = ArraySerializer(Double.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Boolean>): TypedBooleanArrayValue {
|
||||
return object : TypedBooleanArrayValue() {
|
||||
private var internalValue: Array<Boolean> = default
|
||||
@ -360,6 +382,7 @@ internal fun Setting.valueImpl(default: Array<Boolean>): TypedBooleanArrayValue
|
||||
override val serializer = ArraySerializer(Boolean.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<Char>): TypedCharArrayValue {
|
||||
return object : TypedCharArrayValue() {
|
||||
private var internalValue: Array<Char> = default
|
||||
@ -374,6 +397,7 @@ internal fun Setting.valueImpl(default: Array<Char>): TypedCharArrayValue {
|
||||
override val serializer = ArraySerializer(Char.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: Array<String>): TypedStringArrayValue {
|
||||
return object : TypedStringArrayValue() {
|
||||
private var internalValue: Array<String> = default
|
||||
@ -388,6 +412,7 @@ internal fun Setting.valueImpl(default: Array<String>): TypedStringArrayValue {
|
||||
override val serializer = ArraySerializer(String.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Int>): IntListValue {
|
||||
return object : IntListValue() {
|
||||
private var internalValue: List<Int> = default
|
||||
@ -402,6 +427,7 @@ internal fun Setting.valueImpl(default: List<Int>): IntListValue {
|
||||
override val serializer = ListSerializer(Int.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Short>): ShortListValue {
|
||||
return object : ShortListValue() {
|
||||
private var internalValue: List<Short> = default
|
||||
@ -416,6 +442,7 @@ internal fun Setting.valueImpl(default: List<Short>): ShortListValue {
|
||||
override val serializer = ListSerializer(Short.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Byte>): ByteListValue {
|
||||
return object : ByteListValue() {
|
||||
private var internalValue: List<Byte> = default
|
||||
@ -430,6 +457,7 @@ internal fun Setting.valueImpl(default: List<Byte>): ByteListValue {
|
||||
override val serializer = ListSerializer(Byte.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Long>): LongListValue {
|
||||
return object : LongListValue() {
|
||||
private var internalValue: List<Long> = default
|
||||
@ -444,6 +472,7 @@ internal fun Setting.valueImpl(default: List<Long>): LongListValue {
|
||||
override val serializer = ListSerializer(Long.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Float>): FloatListValue {
|
||||
return object : FloatListValue() {
|
||||
private var internalValue: List<Float> = default
|
||||
@ -458,6 +487,7 @@ internal fun Setting.valueImpl(default: List<Float>): FloatListValue {
|
||||
override val serializer = ListSerializer(Float.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Double>): DoubleListValue {
|
||||
return object : DoubleListValue() {
|
||||
private var internalValue: List<Double> = default
|
||||
@ -472,6 +502,7 @@ internal fun Setting.valueImpl(default: List<Double>): DoubleListValue {
|
||||
override val serializer = ListSerializer(Double.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Boolean>): BooleanListValue {
|
||||
return object : BooleanListValue() {
|
||||
private var internalValue: List<Boolean> = default
|
||||
@ -486,6 +517,7 @@ internal fun Setting.valueImpl(default: List<Boolean>): BooleanListValue {
|
||||
override val serializer = ListSerializer(Boolean.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<Char>): CharListValue {
|
||||
return object : CharListValue() {
|
||||
private var internalValue: List<Char> = default
|
||||
@ -500,6 +532,7 @@ internal fun Setting.valueImpl(default: List<Char>): CharListValue {
|
||||
override val serializer = ListSerializer(Char.serializer())
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Setting.valueImpl(default: List<String>): StringListValue {
|
||||
return object : StringListValue() {
|
||||
private var internalValue: List<String> = default
|
||||
@ -650,6 +683,7 @@ internal fun Setting.valueImpl(default: Set<String>): StringSetValue {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmName("valueImplMutableIntList")
|
||||
internal fun Setting.valueImpl(
|
||||
default: MutableList<Int>
|
||||
@ -1281,3 +1315,30 @@ internal fun Setting.valueImpl(
|
||||
}
|
||||
|
||||
|
||||
internal fun <T : Setting> Setting.valueImpl(default: T): Value<T> {
|
||||
return object : SettingValue<T>() {
|
||||
private var internalValue: T = default
|
||||
override var value: T
|
||||
get() = internalValue
|
||||
set(new) {
|
||||
if (new != internalValue) {
|
||||
internalValue = new
|
||||
onElementChanged(this)
|
||||
}
|
||||
}
|
||||
override val serializer = object : KSerializer<T> {
|
||||
override val descriptor: SerialDescriptor
|
||||
get() = internalValue.updaterSerializer.descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): T {
|
||||
internalValue.updaterSerializer.deserialize(decoder)
|
||||
return internalValue
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: T) {
|
||||
internalValue.updaterSerializer.serialize(encoder, SettingSerializerMark)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user