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

scala.build.options.HasScope.scala Maven / Gradle / Ivy

package scala.build.options

final case class HasScope[+T](
  scope: Scope,
  value: T
) {
  def valueFor(currentScope: Scope): Option[T] =
    if (currentScope == scope) Some(value)
    else None
  def valueForInheriting(currentScope: Scope): Option[T] =
    if (currentScope.allScopes.contains(scope)) Some(value)
    else None
  def map[U](f: T => U): HasScope[U] =
    copy(value = f(value))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy