trait Constraints extends AnyRef

Defines a set of built-in constraints.

Source
Validation.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Constraints
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def emailAddress: Constraint[String]

    Defines an ‘emailAddress’ constraint for String values which will validate email addresses.

    Defines an ‘emailAddress’ constraint for String values which will validate email addresses.

    name[constraint.email] error[error.email]

  2. def emailAddress(errorMessage: String = "error.email"): Constraint[String]

    Defines an ‘emailAddress’ constraint for String values which will validate email addresses.

    Defines an ‘emailAddress’ constraint for String values which will validate email addresses.

    name[constraint.email] error[error.email]

  3. def max[T](maxValue: T, strict: Boolean = false, errorMessage: String = "error.max", strictErrorMessage: String = "error.max.strict")(implicit ordering: Ordering[T]): Constraint[T]

    Defines a maximum value for Ordered values, by default the value must be less than or equal to the constraint parameter

    Defines a maximum value for Ordered values, by default the value must be less than or equal to the constraint parameter

    name[constraint.max(maxValue)] error[error.max(maxValue)] or [error.max.strict(maxValue)]

  4. def maxLength(length: Int, errorMessage: String = "error.maxLength"): Constraint[String]

    Defines a maximum length constraint for String values, i.e.

    Defines a maximum length constraint for String values, i.e. the string’s length must be less than or equal to the constraint parameter

    name[constraint.maxLength(length)] error[error.maxLength(length)]

  5. def min[T](minValue: T, strict: Boolean = false, errorMessage: String = "error.min", strictErrorMessage: String = "error.min.strict")(implicit ordering: Ordering[T]): Constraint[T]

    Defines a minimum value for Ordered values, by default the value must be greater than or equal to the constraint parameter

    Defines a minimum value for Ordered values, by default the value must be greater than or equal to the constraint parameter

    name[constraint.min(minValue)] error[error.min(minValue)] or [error.min.strict(minValue)]

  6. def minLength(length: Int, errorMessage: String = "error.minLength"): Constraint[String]

    Defines a minimum length constraint for String values, i.e.

    Defines a minimum length constraint for String values, i.e. the string’s length must be greater than or equal to the constraint parameter

    name[constraint.minLength(length)] error[error.minLength(length)]

  7. def nonEmpty: Constraint[String]

    Defines a ‘required’ constraint for String values, i.e.

    Defines a ‘required’ constraint for String values, i.e. one in which empty strings are invalid.

    name[constraint.required] error[error.required]

  8. def nonEmpty(errorMessage: String = "error.required"): Constraint[String]

    Defines a ‘required’ constraint for String values, i.e.

    Defines a ‘required’ constraint for String values, i.e. one in which empty strings are invalid.

    name[constraint.required] error[error.required]

  9. def pattern(regex: => Regex, name: String = "constraint.pattern", error: String = "error.pattern"): Constraint[String]

    Defines a regular expression constraint for String values, i.e.

    Defines a regular expression constraint for String values, i.e. the string must match the regular expression pattern

    name[constraint.pattern(regex)] or defined by the name parameter. error[error.pattern(regex)] or defined by the error parameter.