15 lines
377 B
Kotlin
Raw Normal View History

2025-03-09 23:45:43 +09:00
package com.tutpro.baresip.plus
import java.util.concurrent.atomic.AtomicBoolean
open class Event<out T>(private val content: T) {
private val hasBeenHandled = AtomicBoolean(false)
fun getContentIfNotHandled(): T? {
return if (hasBeenHandled.get()) {
null
} else {
hasBeenHandled.set(true)
content
}
}
}