Skip to content

Commit a161e3d

Browse files
committed
NullableReference.kt: add class kdoc comments
1 parent 3b53a5a commit a161e3d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/util/NullableReference.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616
package com.google.firebase.dataconnect.util
1717

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+
*/
1823
internal class NullableReference<out T>(val ref: T? = null) {
1924
override fun equals(other: Any?) = (other is NullableReference<*>) && other.ref == ref
2025
override fun hashCode() = ref?.hashCode() ?: 0

0 commit comments

Comments
 (0)