We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b53a5a commit a161e3dCopy full SHA for a161e3d
firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/util/NullableReference.kt
@@ -15,6 +15,11 @@
15
*/
16
package com.google.firebase.dataconnect.util
17
18
+/**
19
+ * A class that simply wraps a reference to another object, possibly a null reference. Instances of
20
+ * this class can be useful for the case where the meaning of `null` is overloaded, such as
21
+ * [kotlinx.coroutines.flow.MutableStateFlow.compareAndSet].
22
+ */
23
internal class NullableReference<out T>(val ref: T? = null) {
24
override fun equals(other: Any?) = (other is NullableReference<*>) && other.ref == ref
25
override fun hashCode() = ref?.hashCode() ?: 0
0 commit comments