LSPS documentation logo
LSPS Documentation
Constraint Types

Core

AssertFalse(message : String)

Applied to: Boolean

The Boolean value must be false.

AssertTrue(message : String)

Applied to: Boolean

The Boolean value must be true.

NotNull(message : String)

Applied to: Object

The value must not be null.

Null(message : String)

Applied to: Object

The value must be null.

NotEmpty(message : String)

Applied to: String

The String value must not be empty.

Empty(message : String)

Applied to: String

The String value must be empty.

Min(lowerBound : Decimal, message : String)

Applied to: Decimal

The Decimal value must be equal to or greater than the specified lowerBound.

Max(upperBound : Decimal, message : String)

Applied to: Decimal

The Decimal value must be equal to or less than the specified upperBound.

Range(lowerBound : Decimal, upperBound : Decimal, message : String)

Applied to: Decimal

The Decimal value must be within the range of the interval [lowerBound, upperBound] (inclusive).

MinLength(min : Integer, message : String)

Applied to: String

The String value must have a length equal to or greater than the specified <i>min</i> value.

MaxLength(max : Integer, message : String)

Applied to: String

The String value must have a length equal to or less than the specified <i>max</i> value.

IsNumber(message : String)

Applied to: String

The String value must represent a decimal number.

Pattern(format : String, message : String)

Applied to: String

The String value must be in the specified format.

format : String

The Java regular expression syntax (as defined in the java.Functions.regex.Pattern class) is used.

Email(message : String)

Applied to: String

The String value must match the e-mail address format.

Past(before : Date, message : String)

Applied to: Date

The Date value must be equal to or before the date specified by the <i>before</i> parameter.

Future(after : Date, message : String)

Applied to: Date

The Date value must be equal to or later than the specified <i>after</i> parameter.

CardinalityMin(min : Integer, condition : {T : Boolean}, message : String)

Applied to: Collection<T>

The cardinality of the collection elements that meet the specified <i>condition</i> must be at least the specified <i>min</i>.

The <i>condition</i> is a closure with an element of the collection as its input parameter.

CardinalityMax(max : Integer, condition : {T : Boolean}, message : String)

Applied to: Collection<T>

The cardinality of the collection elements that meet the specified <i>condition</i> must not be greater than the specified <i>max</i>.

The <i>condition</i> is a closure with an element of the collection as its input parameter.

CardinalityRange(min : Integer, max : Integer, condition : {T : Boolean}, message : String)

Applied to: Collection<T>

The cardinality of the collection elements that meet the specified <i>condition</i> must be in the interval [min, max] (inclusive).

The <i>condition</i> is a closure with an element of the collection as its input parameter.

ExpressionConstraint(expression : {T, Map<String, Object> : String})

Applied to: T

The value must satisfy the constraint given by the specified <i>expression</i>.

ComplexExpressionConstraint(expression : {T, Map<String, Object>, Collection<Tag> : List<ConstraintViolation>})

Applied to: T

The value must satisfy the constraint given by the specified <i>expression</i>.

RecordValidity()

Applied to: Record

All properties of the Record value must be valid.

RecordCollectionValidity()

Applied to: Collection<Record>

All records from the collection must be valid.