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

xitrum.validator.Required.scala Maven / Gradle / Ivy

The newest version!
package xitrum.validator

object Required extends Validator[String] {
  def check(value: String): Boolean = value.trim.nonEmpty

  def message(name: String, value: String): Option[String] =
    if (value.trim.isEmpty)
      Some("%s must not be empty".format(name))
    else
      None
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy