We welcome our DelegateSyncher overlord
This commit is contained in:
parent
26a0595742
commit
13d213f5f2
@ -4,7 +4,7 @@ kotlin.code.style=official
|
|||||||
specifyKotlinAsDependency=false
|
specifyKotlinAsDependency=false
|
||||||
|
|
||||||
projectGroup=ru.dbotthepony.kommons
|
projectGroup=ru.dbotthepony.kommons
|
||||||
projectVersion=2.7.10
|
projectVersion=2.8.0
|
||||||
|
|
||||||
guavaDepVersion=33.0.0
|
guavaDepVersion=33.0.0
|
||||||
gsonDepVersion=2.8.9
|
gsonDepVersion=2.8.9
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -83,6 +83,14 @@ class KOptional<T> private constructor(private val _value: T, val isPresent: Boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun valueEquals(other: Any?): Boolean {
|
||||||
|
if (isPresent) {
|
||||||
|
return _value == other
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
return this === other || other is KOptional<*> && isPresent == other.isPresent && _value == other._value
|
return this === other || other is KOptional<*> && isPresent == other.isPresent && _value == other._value
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ interface ValueObserver<V> : Listenable<V>, Supplier<V>, Observer {
|
|||||||
*
|
*
|
||||||
* This implementation is not synchronized, calls to [get]/[observe]/[getAndObserve] from multiple threads
|
* This implementation is not synchronized, calls to [get]/[observe]/[getAndObserve] from multiple threads
|
||||||
* will result in undefined behavior;
|
* will result in undefined behavior;
|
||||||
* For thread-safe implementation, use [SynchronizedObserved].
|
* For thread-safe implementation, use [SynchronizedImpl].
|
||||||
*/
|
*/
|
||||||
class Impl<V>(private val provider: Supplier<V>) : ValueObserver<V> {
|
class Impl<V>(private val provider: Supplier<V>) : ValueObserver<V> {
|
||||||
private val subs = Listenable.Impl<V>()
|
private val subs = Listenable.Impl<V>()
|
||||||
|
Loading…
Reference in New Issue
Block a user