com.github.ghik.silencer.OptRef.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silencer-plugin_2.13.15 Show documentation
Show all versions of silencer-plugin_2.13.15 Show documentation
Scala compiler plugin for annotation-based warning suppression
package com.github.ghik.silencer
// for name based extractors
final class OptRef[+T >: Null] private(private val value: T) extends AnyVal {
def isEmpty: Boolean = value == null
def get: T = value
}
object OptRef {
def apply[T >: Null](value: T): OptRef[T] = new OptRef(value)
def empty: OptRef[Null] = new OptRef(null)
}