2025-03-09 23:45:43 +09:00

15 lines
377 B
Kotlin

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
}
}
}