-
public final class MutableLiveEvent<T extends Object> extends LiveEvent<T>
-
-
Field Summary
Fields Modifier and Type Field Description private final ObjectmDataLockprivate final IntegermActiveCountprivate final ObjectmPendingData
-
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 com.alfresco.auth.data.LiveEvent
changeActiveCounter, dispatchingValue, getValue, getVersion, hasActiveObservers, hasObservers, observeForever, onActive, onInactive, 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.
-
-
-
-