Constraints

com.greenfossil.data.mapping.Constraints$
See theConstraints companion trait
object Constraints extends Constraints

Defines a set of built-in constraints.

Attributes

Companion
trait
Graph
Supertypes
trait Constraints
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited methods

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]

Attributes

Inherited from:
Constraints
def emailAddress(errorMessage: String): 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]

Attributes

Inherited from:
Constraints
def max[T](maxValue: T, strict: Boolean, errorMessage: String, strictErrorMessage: String)(using 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)]

Attributes

Inherited from:
Constraints
def maxLength(length: Int, errorMessage: String): Constraint[String]

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

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)]

Attributes

Inherited from:
Constraints
def min[T](minValue: T, strict: Boolean, errorMessage: String, strictErrorMessage: String)(using 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)]

Attributes

Inherited from:
Constraints
def minLength(length: Int, errorMessage: String): Constraint[String]

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

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)]

Attributes

Inherited from:
Constraints
def mobileNumber: Constraint[String]

$mobileNumberDoc

$mobileNumberDoc

Attributes

Inherited from:
Constraints
def mobileNumber(errorMessage: String): Constraint[String]

$mobileNumberDoc

$mobileNumberDoc

Attributes

Inherited from:
Constraints
def nonEmpty: Constraint[String]

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

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

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

Attributes

Inherited from:
Constraints
def nonEmpty(errorMessage: String): Constraint[String]

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

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

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

Attributes

Inherited from:
Constraints
def pattern(regex: => Regex, name: String, error: String): Constraint[String]

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

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.

Attributes

Inherited from:
Constraints
def phoneNumber: Constraint[String]

$phoneNumberDoc

$phoneNumberDoc

Attributes

Inherited from:
Constraints
def phoneNumber(errorMessage: String): Constraint[String]

$phoneNumberDoc

$phoneNumberDoc

Attributes

Inherited from:
Constraints
def precision(precision: Int, scale: Int, name: String, error: String): Constraint[BigDecimal]

Checks the precision and scale of the given BigDecimal https://stackoverflow.com/questions/35435691/bigdecimal-precision-and-scale

Checks the precision and scale of the given BigDecimal https://stackoverflow.com/questions/35435691/bigdecimal-precision-and-scale

Attributes

Inherited from:
Constraints

Concrete fields

val EMAIL: String
val MAX: String
val MAX_LENGTH: String
val MIN: String
val MIN_LENGTH: String
val MOBILE: String
val PATTERN: String
val PHONE: String
val PRECISION: String
val REQUIRED: String