Package com.alfresco.auth.data
Class MutableLiveEvent
-
- All Implemented Interfaces:
public final class MutableLiveEvent<T extends Object> extends LiveEvent<T>
-
-
Constructor Summary
Constructors Constructor Description MutableLiveEvent()
-
Method Summary
Modifier and Type Method Description Unitobserve(LifecycleOwner owner, Observer<in T> observer)Similar to LiveData.observe adds the given observer to the observers list within the lifespan of the given owner. UnitsetValue(T value)Similar to LiveData.setValue but ensures data is only delivered during an explicit call. UnitpostValue(T value)Similar to LiveData.postValue. final Unitcall()Used for cases where T is Void, to make calls cleaner. -
Methods inherited from class androidx.lifecycle.LiveData
getValue, hasActiveObservers, hasObservers, isInitialized, observeForever, removeObserver, removeObservers -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
observe
@MainThread() Unit observe(LifecycleOwner owner, Observer<in T> observer)
Similar to LiveData.observe adds the given observer to the observers list within the lifespan of the given owner. The events are dispatched on the main thread. Data will only be delivered to the observer only on explicit setValue/postValue.
-
setValue
@MainThread() Unit setValue(T value)
Similar to LiveData.setValue but ensures data is only delivered during an explicit call.
-
postValue
Unit postValue(T value)
Similar to LiveData.postValue.
-
call
@MainThread() final Unit call()
Used for cases where T is Void, to make calls cleaner.
-
-
-
-