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 or greater than the specified lowerBound.

Max(upperBound : Decimal, message : String)

Applied to: Decimal

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

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

Applied to: Decimal

The Decimal value must be in range given by interval [lowerBound, upperBound] (inclusive).

MinLength(min : Integer, message : String)

Applied to: String

The String value must be of length equal or greater than the specified min value.

MaxLength(max : Integer, message : String)

Applied to: String

The String value must be of length equal or less than the specified max 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 match to 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 to e-mail format.

Past(before : Date, message : String)

Applied to: Date

The Date value must be the same or older than the specified before parameter.

Future(after : Date, message : String)

Applied to: Date

The Date value must be the same or newer than the specified after parameter.

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

Applied to: Collection<T>

Cardinality of the Collection items satisfying the specified condition must be at least as the specified min.

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

Applied to: Collection<T>

Cardinality of the Collection items satisfying the specified condition must be at most as the specified max.

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

Applied to: Collection<T>

Cardinality of the Collection items satisfying the specified condition must be in interval [min, max] (inclusive).

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

Applied to: T

The value must satisfy the constraint given by the specified expression.

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

Applied to: T

The value must satisfy the constraint given by the specified expression.

RecordValidity()

Applied to: Record

All properties of the Record value must be valid.

RecordCollectionValidity()

Applied to: Collection<Record>

All records from the collection value must be valid.