Add DelegateSyncher.enum
This commit is contained in:
parent
e9062ab21c
commit
4e2c28a1b2
@ -4,7 +4,7 @@ kotlin.code.style=official
|
|||||||
specifyKotlinAsDependency=false
|
specifyKotlinAsDependency=false
|
||||||
|
|
||||||
projectGroup=ru.dbotthepony.kommons
|
projectGroup=ru.dbotthepony.kommons
|
||||||
projectVersion=2.8.1
|
projectVersion=2.8.2
|
||||||
|
|
||||||
guavaDepVersion=33.0.0
|
guavaDepVersion=33.0.0
|
||||||
gsonDepVersion=2.8.9
|
gsonDepVersion=2.8.9
|
||||||
|
@ -507,14 +507,21 @@ class DelegateSyncher : Observer {
|
|||||||
return add(ListenableDelegate.maskSmart(value, getter, setter), DecimalValueCodec)
|
return add(ListenableDelegate.maskSmart(value, getter, setter), DecimalValueCodec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmOverloads
|
||||||
fun <E> set(codec: StreamCodec<E>, backing: MutableSet<E> = ObjectOpenHashSet()): SetSlot<E> {
|
fun <E> set(codec: StreamCodec<E>, backing: MutableSet<E> = ObjectOpenHashSet()): SetSlot<E> {
|
||||||
return add(ListenableSet(backing), codec)
|
return add(ListenableSet(backing), codec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmOverloads
|
||||||
fun <K, V> map(keyCodec: StreamCodec<K>, valueCodec: StreamCodec<V>, backing: MutableMap<K, V> = Object2ObjectOpenHashMap()): MapSlot<K, V> {
|
fun <K, V> map(keyCodec: StreamCodec<K>, valueCodec: StreamCodec<V>, backing: MutableMap<K, V> = Object2ObjectOpenHashMap()): MapSlot<K, V> {
|
||||||
return add(ListenableMap(backing), keyCodec, valueCodec)
|
return add(ListenableMap(backing), keyCodec, valueCodec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmOverloads
|
||||||
|
fun <E : Enum<E>> enum(value: E, setter: DelegateSetter<E> = DelegateSetter.passthrough(), getter: DelegateGetter<E> = DelegateGetter.passthrough()): Slot<E> {
|
||||||
|
return add(ListenableDelegate.maskSmart(value, getter, setter), StreamCodec.Enum(value::class.java))
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remotes must be [close]d when no longer in use, otherwise they will
|
* Remotes must be [close]d when no longer in use, otherwise they will
|
||||||
* leak memory and decrease performance of syncher.
|
* leak memory and decrease performance of syncher.
|
||||||
|
Loading…
Reference in New Issue
Block a user