//Extensions for Jetpack Lifecycle/it.czerwinski.android.lifecycle.livedata/GroupedLiveData

GroupedLiveData

[androidJvm] class GroupedLiveData<K, V>(keySelector: (V) -> K) : MediatorLiveData<V>

MediatorLiveData subclass which provides a separate LiveData per each result returned by keySelector function executed on subsequent values emitted by the source LiveData.

Constructors

   
GroupedLiveData [androidJvm] fun <K, V> GroupedLiveData(keySelector: (V) -> K)

Functions

Name Summary
addSource [androidJvm]
Content
@MainThread()

open fun <S : Any> addSource(@NonNull()source: LiveData<S>, @NonNull()onChanged: Observer<in S>)


changeActiveCounter [androidJvm]
Content
@MainThread()

open fun changeActiveCounter(p0: Int)


dispatchingValue [androidJvm]
Content
open fun dispatchingValue(@Nullable()p0: LiveData.ObserverWrapper<V>?)


get [androidJvm]
Content
operator fun get(key: K): LiveData<V>
More info
Returns a LiveData emitting only values, for which the result of the keySelector function is equal to the given key.


getValue [androidJvm]
Content
@Nullable()

open fun getValue(): V?


getVersion [androidJvm]
Content
open fun getVersion(): Int


hasActiveObservers [androidJvm]
Content
open fun hasActiveObservers(): Boolean


hasObservers [androidJvm]
Content
open fun hasObservers(): Boolean


observe [androidJvm]
Content
@MainThread()

open fun observe(@NonNull()p0: LifecycleOwner, @NonNull()p1: Observer<in V>)


observeForever [androidJvm]
Content
@MainThread()

open fun observeForever(@NonNull()p0: Observer<in V>)


onActive [androidJvm]
Content
@CallSuper()

open override fun onActive()


onInactive [androidJvm]
Content
@CallSuper()

open override fun onInactive()


postValue [androidJvm]
Content
open override fun postValue(p0: V)


removeObserver [androidJvm]
Content
@MainThread()

open fun removeObserver(@NonNull()p0: Observer<in V>)


removeObservers [androidJvm]
Content
@MainThread()

open fun removeObservers(@NonNull()p0: LifecycleOwner)


removeSource [androidJvm]
Content
@MainThread()

open fun <S : Any> removeSource(@NonNull()toRemote: LiveData<S>)


setValue [androidJvm]
Content
open override fun setValue(value: V)


Properties

Name Summary
mActiveCount [androidJvm] val mActiveCount: Int
mDataLock [androidJvm] val mDataLock: Any
mPendingData [androidJvm] val mPendingData: Any