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

com.github.t3hnar.scalax.ToBooleanOpt.scala Maven / Gradle / Ivy

The newest version!
package com.github.t3hnar.scalax

object ToBooleanOpt {
  private val map: Map[String, Boolean] = Map(
    "true" -> true,
    "false" -> false,
    "+" -> true,
    "-" -> false,
    "on" -> true,
    "off" -> false,
    "yes" -> true,
    "no" -> false)

  def apply(x: String): Option[Boolean] = map.get(x.toLowerCase)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy