diff --git a/gradle.properties b/gradle.properties index 261b2f1..9d8f0ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=1.7.3 +projectVersion=1.7.4 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/event/IDoubleSubcripable.kt b/src/main/kotlin/ru/dbotthepony/kommons/event/IDoubleSubcriptable.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/kommons/event/IDoubleSubcripable.kt rename to src/main/kotlin/ru/dbotthepony/kommons/event/IDoubleSubcriptable.kt index b065bd6..641b0a1 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/event/IDoubleSubcripable.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/event/IDoubleSubcriptable.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.kommons.event import java.util.function.Consumer import java.util.function.DoubleConsumer -interface IDoubleSubcripable : ISubscriptable { +interface IDoubleSubcriptable : ISubscriptable { @Deprecated("Use type specific listener") override fun addListener(listener: Consumer): ISubscriptable.L { return addListener(DoubleConsumer { listener.accept(it) }) @@ -11,7 +11,7 @@ interface IDoubleSubcripable : ISubscriptable { fun addListener(listener: DoubleConsumer): ISubscriptable.L - class Impl : IDoubleSubcripable, Consumer, DoubleConsumer { + class Impl : IDoubleSubcriptable, Consumer, DoubleConsumer { private inner class L(val callback: DoubleConsumer) : ISubscriptable.L { private var isRemoved = false diff --git a/src/main/kotlin/ru/dbotthepony/kommons/event/IFloatSubcripable.kt b/src/main/kotlin/ru/dbotthepony/kommons/event/IFloatSubcriptable.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/kommons/event/IFloatSubcripable.kt rename to src/main/kotlin/ru/dbotthepony/kommons/event/IFloatSubcriptable.kt index e162dd4..412bd1a 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/event/IFloatSubcripable.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/event/IFloatSubcriptable.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.kommons.event import it.unimi.dsi.fastutil.floats.FloatConsumer import java.util.function.Consumer -interface IFloatSubcripable : ISubscriptable { +interface IFloatSubcriptable : ISubscriptable { @Deprecated("Use type specific listener") override fun addListener(listener: Consumer): ISubscriptable.L { return addListener(listener::accept) @@ -11,7 +11,7 @@ interface IFloatSubcripable : ISubscriptable { fun addListener(listener: FloatConsumer): ISubscriptable.L - class Impl : IFloatSubcripable, Consumer, FloatConsumer { + class Impl : IFloatSubcriptable, Consumer, FloatConsumer { private inner class L(val callback: FloatConsumer) : ISubscriptable.L { private var isRemoved = false diff --git a/src/main/kotlin/ru/dbotthepony/kommons/event/IIntSubcripable.kt b/src/main/kotlin/ru/dbotthepony/kommons/event/IIntSubcriptable.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/kommons/event/IIntSubcripable.kt rename to src/main/kotlin/ru/dbotthepony/kommons/event/IIntSubcriptable.kt index 234d3be..8ddeecf 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/event/IIntSubcripable.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/event/IIntSubcriptable.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.kommons.event import java.util.function.Consumer import java.util.function.IntConsumer -interface IIntSubcripable : ISubscriptable { +interface IIntSubcriptable : ISubscriptable { @Deprecated("Use type specific listener") override fun addListener(listener: Consumer): ISubscriptable.L { return addListener(IntConsumer { listener.accept(it) }) @@ -11,7 +11,7 @@ interface IIntSubcripable : ISubscriptable { fun addListener(listener: IntConsumer): ISubscriptable.L - class Impl : IIntSubcripable, Consumer, IntConsumer { + class Impl : IIntSubcriptable, Consumer, IntConsumer { private inner class L(val callback: IntConsumer) : ISubscriptable.L { private var isRemoved = false diff --git a/src/main/kotlin/ru/dbotthepony/kommons/event/ILongSubcripable.kt b/src/main/kotlin/ru/dbotthepony/kommons/event/ILongSubcriptable.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/kommons/event/ILongSubcripable.kt rename to src/main/kotlin/ru/dbotthepony/kommons/event/ILongSubcriptable.kt index c3693d1..8c41aa5 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/event/ILongSubcripable.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/event/ILongSubcriptable.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.kommons.event import java.util.function.Consumer import java.util.function.LongConsumer -interface ILongSubcripable : ISubscriptable { +interface ILongSubcriptable : ISubscriptable { @Deprecated("Use type specific listener") override fun addListener(listener: Consumer): ISubscriptable.L { return addListener(LongConsumer { listener.accept(it) }) @@ -11,7 +11,7 @@ interface ILongSubcripable : ISubscriptable { fun addListener(listener: LongConsumer): ISubscriptable.L - class Impl : ILongSubcripable, Consumer, LongConsumer { + class Impl : ILongSubcriptable, Consumer, LongConsumer { private inner class L(val callback: LongConsumer) : ISubscriptable.L { private var isRemoved = false diff --git a/src/main/kotlin/ru/dbotthepony/kommons/event/IUnitSubscripable.kt b/src/main/kotlin/ru/dbotthepony/kommons/event/IUnitSubscriptable.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/kommons/event/IUnitSubscripable.kt rename to src/main/kotlin/ru/dbotthepony/kommons/event/IUnitSubscriptable.kt index 82ac6ab..f6402e0 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/event/IUnitSubscripable.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/event/IUnitSubscriptable.kt @@ -2,14 +2,14 @@ package ru.dbotthepony.kommons.event import java.util.function.Consumer -interface IUnitSubscripable : ISubscriptable { +interface IUnitSubscriptable : ISubscriptable { fun addListener(listener: Runnable): ISubscriptable.L override fun addListener(listener: Consumer): ISubscriptable.L { return addListener(Runnable { listener.accept(Unit) }) } - class Impl : IUnitSubscripable, Runnable { + class Impl : IUnitSubscriptable, Runnable { private inner class L(val callback: Runnable) : ISubscriptable.L { private var isRemoved = false diff --git a/src/main/kotlin/ru/dbotthepony/kommons/networking/FieldSynchronizer.kt b/src/main/kotlin/ru/dbotthepony/kommons/networking/FieldSynchronizer.kt index f46ea6e..e0766ed 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/networking/FieldSynchronizer.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/networking/FieldSynchronizer.kt @@ -10,10 +10,10 @@ import it.unimi.dsi.fastutil.objects.ReferenceArraySet import ru.dbotthepony.kommons.collect.ProxiedMap import ru.dbotthepony.kommons.collect.forValidRefs import ru.dbotthepony.kommons.event.IBooleanSubscriptable -import ru.dbotthepony.kommons.event.IDoubleSubcripable -import ru.dbotthepony.kommons.event.IFloatSubcripable -import ru.dbotthepony.kommons.event.IIntSubcripable -import ru.dbotthepony.kommons.event.ILongSubcripable +import ru.dbotthepony.kommons.event.IDoubleSubcriptable +import ru.dbotthepony.kommons.event.IFloatSubcriptable +import ru.dbotthepony.kommons.event.IIntSubcriptable +import ru.dbotthepony.kommons.event.ILongSubcriptable import ru.dbotthepony.kommons.event.ISubscriptable import ru.dbotthepony.kommons.io.BigDecimalValueCodec import ru.dbotthepony.kommons.io.BinaryStringCodec @@ -49,7 +49,6 @@ import java.util.function.IntSupplier import java.util.function.LongConsumer import java.util.function.LongSupplier import java.util.function.Supplier -import kotlin.collections.LinkedHashSet import kotlin.reflect.KMutableProperty0 import kotlin.reflect.KProperty import kotlin.reflect.KProperty0 @@ -620,7 +619,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa * Type specific field, storing primitive [Float] directly */ inner class FloatField(field: Float, private val getter: FloatFieldGetter? = null, private val setter: FloatFieldSetter? = null) : PrimitiveField(), IMutableFloatField { - private val subs = IFloatSubcripable.Impl() + private val subs = IFloatSubcriptable.Impl() override fun addListener(listener: FloatConsumer): ISubscriptable.L { return subs.addListener(listener) @@ -701,7 +700,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa * Type specific field, storing primitive [Double] directly */ inner class DoubleField(field: Double, private val getter: DoubleFieldGetter? = null, private val setter: DoubleFieldSetter? = null) : PrimitiveField(), IMutableDoubleField { - private val subs = IDoubleSubcripable.Impl() + private val subs = IDoubleSubcriptable.Impl() override fun addListener(listener: DoubleConsumer): ISubscriptable.L { return subs.addListener(listener) @@ -779,7 +778,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa } abstract inner class AbstractIntField(field: Int, private val getter: IntFieldGetter? = null, protected val setter: IntFieldSetter? = null) : PrimitiveField(), IMutableIntField { - private val subs = IIntSubcripable.Impl() + private val subs = IIntSubcriptable.Impl() override fun addListener(listener: IntConsumer): ISubscriptable.L { return subs.addListener(listener) @@ -888,7 +887,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa * Type specific field, storing primitive [Long] directly */ abstract inner class AbstractLongField(field: Long, private val getter: LongFieldGetter? = null, protected val setter: LongFieldSetter? = null) : PrimitiveField(), IMutableLongField { - private val subs = ILongSubcripable.Impl() + private val subs = ILongSubcriptable.Impl() override fun addListener(listener: LongConsumer): ISubscriptable.L { return subs.addListener(listener) @@ -1149,7 +1148,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa private var isRemoteSet = false private var clientValue: Float = 0f private var isClientValue = false - private val subs = IFloatSubcripable.Impl() + private val subs = IFloatSubcriptable.Impl() init { if (observer != null) { @@ -1231,7 +1230,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa private var isRemoteSet = false private var clientValue: Double = 0.0 private var isClientValue = false - private val subs = IDoubleSubcripable.Impl() + private val subs = IDoubleSubcriptable.Impl() init { if (observer != null) { @@ -1316,7 +1315,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa } protected var isClientValue = false - private val subs = IIntSubcripable.Impl() + private val subs = IIntSubcriptable.Impl() init { if (observer != null) { @@ -1423,7 +1422,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa } protected var isClientValue = false - private val subs = ILongSubcripable.Impl() + private val subs = ILongSubcriptable.Impl() init { if (observer != null) { diff --git a/src/main/kotlin/ru/dbotthepony/kommons/networking/Fields.kt b/src/main/kotlin/ru/dbotthepony/kommons/networking/Fields.kt index b7db5d2..efdbe36 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/networking/Fields.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/networking/Fields.kt @@ -1,10 +1,10 @@ package ru.dbotthepony.kommons.networking import ru.dbotthepony.kommons.event.IBooleanSubscriptable -import ru.dbotthepony.kommons.event.IDoubleSubcripable -import ru.dbotthepony.kommons.event.IFloatSubcripable -import ru.dbotthepony.kommons.event.IIntSubcripable -import ru.dbotthepony.kommons.event.ILongSubcripable +import ru.dbotthepony.kommons.event.IDoubleSubcriptable +import ru.dbotthepony.kommons.event.IFloatSubcriptable +import ru.dbotthepony.kommons.event.IIntSubcriptable +import ru.dbotthepony.kommons.event.ILongSubcriptable import ru.dbotthepony.kommons.event.ISubscriptable import ru.dbotthepony.kommons.util.FloatSupplier import java.io.DataInputStream @@ -46,7 +46,7 @@ interface IFloatProperty { operator fun getValue(thisRef: Any?, property: KProperty<*>): Float } -sealed interface IFloatField : IField, FloatSupplier, IFloatSubcripable { +sealed interface IFloatField : IField, FloatSupplier, IFloatSubcriptable { val float: Float val property: IFloatProperty @@ -72,7 +72,7 @@ interface IDoubleProperty { operator fun getValue(thisRef: Any?, property: KProperty<*>): Double } -sealed interface IDoubleField : IField, DoubleSupplier, IDoubleSubcripable { +sealed interface IDoubleField : IField, DoubleSupplier, IDoubleSubcriptable { val double: Double val property: IDoubleProperty @@ -98,7 +98,7 @@ interface IIntProperty { operator fun getValue(thisRef: Any?, property: KProperty<*>): Int } -sealed interface IIntField : IField, IntSupplier, IIntSubcripable { +sealed interface IIntField : IField, IntSupplier, IIntSubcriptable { val int: Int val property: IIntProperty @@ -124,7 +124,7 @@ interface ILongProperty { operator fun getValue(thisRef: Any?, property: KProperty<*>): Long } -sealed interface ILongField : IField, LongSupplier, ILongSubcripable { +sealed interface ILongField : IField, LongSupplier, ILongSubcriptable { val long: Long val property: ILongProperty