string

io.github.iltotore.iron.constraint.string
object string

String-related constraints.

Attributes

See also

collection

Source
string.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
string.type

Members list

Type members

Classlikes

object Blank

Attributes

Source
string.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Blank.type
final class EndWith[V <: String]

Tests if the input ends with the given suffix.

Tests if the input ends with the given suffix.

Type parameters

V

the string to compare with the end of the input.

Attributes

Companion
object
Source
string.scala
Supertypes
class Object
trait Matchable
class Any
object EndWith

Attributes

Companion
class
Source
string.scala
Supertypes
class Object
trait Matchable
class Any
Self type
EndWith.type
final class Match[V <: String]

Tests if the input matches the given regex.

Tests if the input matches the given regex.

Type parameters

V

the pattern to match against the input.

Attributes

Companion
object
Source
string.scala
Supertypes
class Object
trait Matchable
class Any
object Match

Attributes

Companion
class
Source
string.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Match.type
final class StartWith[V <: String]

Tests if the input starts with the given prefix.

Tests if the input starts with the given prefix.

Type parameters

V

the string to compare with the start of the input.

Attributes

Companion
object
Source
string.scala
Supertypes
class Object
trait Matchable
class Any
object StartWith

Attributes

Companion
class
Source
string.scala
Supertypes
class Object
trait Matchable
class Any
Self type
StartWith.type

Types

type Alphanumeric = DescribedAs[ForAll[Digit | Letter], "Should be alphanumeric"]

Tests if the input only contains alphanumeric characters.

Tests if the input only contains alphanumeric characters.

Attributes

Source
string.scala
type Blank = DescribedAs[ForAll[Whitespace], "Should only contain whitespaces"]

Tests if the input only contains whitespaces.

Tests if the input only contains whitespaces.

Attributes

See also

Whitespace

Source
string.scala
type LettersLowerCase = DescribedAs[ForAll[Not[Letter] | LowerCase], "All letters should be lower cased"]

Tests if all letters of the input are lower cased.

Tests if all letters of the input are lower cased.

Attributes

Source
string.scala
type LettersUpperCase = DescribedAs[ForAll[Not[Letter] | UpperCase], "All letters should be upper cased"]

Tests if all letters of the input are upper cased.

Tests if all letters of the input are upper cased.

Attributes

Source
string.scala
type SemanticVersion = Match["^v?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"]

Tests if the input is a valid semantic version as defined in semver site.

Tests if the input is a valid semantic version as defined in semver site.

Attributes

Source
string.scala
type Trimmed = DescribedAs[Empty | Not[Head[Whitespace] | Last[Whitespace]], "Should not have leading or trailing whitespaces"]

Tests if the input does not have leading or trailing whitespaces.

Tests if the input does not have leading or trailing whitespaces.

Attributes

See also

Whitespace

Source
string.scala
type ValidURL = DescribedAs[Match["((\\w+:)+\\/\\/)?(([-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6})|(localhost))(:\\d{1,5})?(\\/|\\/([-a-zA-Z0-9@:%_\\+.~#?&//=]*))?"], "Should be an URL"]

Tests if the input is a valid URL.

Tests if the input is a valid URL.

Attributes

Note

it only checks if the input fits the URL pattern. Not if the given URL exists/is accessible.

Source
string.scala
type ValidUUID = DescribedAs[Match["^([0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12})"], "Should be an UUID"]

Tests if the input is a valid UUID.

Tests if the input is a valid UUID.

Attributes

Source
string.scala