contains

fun <E> LiveData<out Collection<E>?>.contains(element: E): Boolean

Return

true if element is contained in the collection that the LiveData holds. false if the element is not contained or if the LiveData doesn't have a value.


operator fun <K> LiveData<out Map<K, *>>.contains(key: K): Boolean

Returns true if the LiveData's value contains the specified key.

This method allows to use the x in map syntax for checking whether an object is contained in the map.