This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit val booleanFormatter: Formatter[Boolean] = new Formatter[Boolean] { | |
override val format = Some(("format.boolean", Nil)) | |
override def bind(key: String, data: Map[String, String]): Either[Seq[FormError], Boolean] = | |
data.get(key) match { | |
case Some(value) => value match { | |
case "true" => Right(true) | |
case "false" => Right(false) | |
case _ => Left(Seq(FormError(key, "error.boolean", Nil))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package wolfendale | |
import shapeless._ | |
import shapeless.labelled._ | |
import scala.util.{Failure, Success, Try} | |
trait FromStringMap[A] { | |
def apply(data: Map[String, String]): Try[A] | |
} |
NewerOlder