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

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

There is a newer version: 3.28.18
Show newest version
package xitrum.validator

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy