Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
*/
package com.google.firebase.dataconnect.util

internal class NullableReference<T>(val ref: T? = null) {
/**
* A class that simply wraps a reference to another object, possibly a null reference. Instances of
* this class can be useful for the case where the meaning of `null` is overloaded, such as
* [kotlinx.coroutines.flow.MutableStateFlow.compareAndSet].
*/
internal class NullableReference<out T>(val ref: T? = null) {
override fun equals(other: Any?) = (other is NullableReference<*>) && other.ref == ref
override fun hashCode() = ref?.hashCode() ?: 0
override fun toString() = ref?.toString() ?: "null"
Expand Down
Loading