StringSpec class final

Specification for string types.

Inheritance

Constructors

StringSpec({StringFormat? format, String? pattern, int? minLength, int? maxLength, String? defaultValue, String? description, bool nullable = false, List<Object>? examples, bool isDeprecated = false})
Creates a new StringSpec.
const

Properties

defaultValue → String?
Default value.
final
description → String?
Optional description of this type.
finalinherited
examples → List<Object>?
Example values for documentation.
finalinherited
format → StringFormat?
Format hint for the string value.
final
hashCode → int
The hash code for this object.
no setterinherited
isDeprecated → bool
Whether this type is deprecated.
finalinherited
maxLength → int?
Maximum length of the string.
final
minLength → int?
Minimum length of the string.
final
nullable → bool
Whether this type accepts null values.
finalinherited
pattern → String?
Regular expression pattern for validation.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

asNullable() → StringSpec
Creates a copy of this spec with nullable set to true.
override
copyWith({StringFormat? format, String? pattern, int? minLength, int? maxLength, String? defaultValue, String? description, bool? nullable, List<Object>? examples, bool? isDeprecated}) → StringSpec
Creates a copy with the given modifications.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withDescription(String description) → StringSpec
Creates a copy of this spec with the given description.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited