All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ghik.silencer.OptRef.scala Maven / Gradle / Ivy

There is a newer version: 1.7.19
Show newest version
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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy