-
Creates a
AndConstraint
type with an array of child constraints and a set ofGroup
s to group by.Declaration
Swift
case and(_: [Constraint], groups: Set<Group> = .init())
Parameters
constraints
An array of child constraints.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
BlankConstraint
type with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case blank(_: String = BlankConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates an
EmailConstraint
type with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case email(_: String = EmailConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates an
IntegerConstraint
type with minimum/maximum values, custom minimum/maximum error messages, and a set ofGroup
s to group by.Declaration
Swift
case integer( min: Int = IntegerConstraint.min, max: Int = IntegerConstraint.max, minMessage: String = IntegerConstraint.minMessage, maxMessage: String = IntegerConstraint.maxMessage, exactMessage: String = IntegerConstraint.exactMessage, groups: Set<Group> = .init() )
Parameters
min
A custom minimum value. Defaults to the default minimum value.
max
A custom maximum value. Defaults to the default maximum value.
minMessage
A custom error message to show for a minimum value violation. Defaults to the default minimum value violation error message.
maxMessage
A custom error message to show for a maximum value violation. Defaults to the default maximum value violation error message.
exactMessage
A custom error message to show for an exact value violation. Defaults to the default exact value violation error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates an
IPConstraint
type with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case ip(_: String = IPConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
JSONConstraint
type with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case json(_: String = JSONConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
LengthConstraint
type with minimum/maximum values, custom minimum/maximum error messages, and a set ofGroup
s to group by.Declaration
Swift
case length( min: UInt = LengthConstraint.min, max: UInt = LengthConstraint.max, minMessage: String = LengthConstraint.minMessage, maxMessage: String = LengthConstraint.maxMessage, exactMessage: String = LengthConstraint.exactMessage, groups: Set<Group> = .init() )
Parameters
min
A custom minimum value. Defaults to the default minimum value.
max
A custom maximum value. Defaults to the default maximum value.
minMessage
A custom error message to show for a minimum value violation. Defaults to the default minimum value violation error message.
maxMessage
A custom error message to show for a maximum value violation. Defaults to the default maximum value violation error message.
exactMessage
A custom error message to show for an exact value violation. Defaults to the default exact value violation error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
NotBlankConstraint
type with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case notBlank(_: String = NotBlankConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
OrConstraint
type with an array of child constraints and a set ofGroup
s to group by.Declaration
Swift
case or(_: [Constraint], groups: Set<Group> = .init())
Parameters
constraints
An array of child constraints.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
RegexConstraint
type with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case regex(_: String = RegexConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
URLConstraint
type with a file URL flag, a custom error message, and a set ofGroup
s to group by.Declaration
Swift
case url(_: String = URLConstraint.message, isFileURL: Bool, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
isFileURL
Indicates whether it is a file URL or not. Defaults to
false
.groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
UUIDConstraint
type with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case uuid(_: String = UUIDConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
Creates a
VINConstraint
with a custom error message and a set ofGroup
s to group by.Declaration
Swift
case vin(_: String = VINConstraint.message, groups: Set<Group> = .init())
Parameters
message
A custom error message. Defaults to the default error message.
groups
A set of
Group
s to group by. Defaults to an empty set. -
A matching
Constraint
for aConstraintType
.Declaration
Swift
public var constraint: Constraint { get }