collection

io.github.iltotore.iron.constraint.collection$
object collection

Collection-related constraints.

Attributes

See also:

string which contains String-specific implementations for most of these constraints.

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

final class Contain[V]

Tests if the given collection contains a specific value.

Tests if the given collection contains a specific value.

Attributes

V

the value the input must contain.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Contain

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Contain.type
final class Exists[C]

Tests if at least one element satisfies the given constraint.

Tests if at least one element satisfies the given constraint.

Attributes

C

the constraint to test against each element.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Exists

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Exists.type
final class ForAll[C]

Tests if each element satisfies the given constraint.

Tests if each element satisfies the given constraint.

Attributes

C

the constraint to test against each element.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object ForAll

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ForAll.type
final class Head[C]

Tests if the head of the passed input satisfies the given constraint.

Tests if the head of the passed input satisfies the given constraint.

Attributes

C

the constraint to test against the first element (head).

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Head

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Head.type
final class Init[C]

Tests if each element except the last one satisfies the given constraint.

Tests if each element except the last one satisfies the given constraint.

Attributes

C

the constraint to test against the init.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Init

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Init.type
final class Last[C]

Tests if the last element of the passed input satisfies the given constraint.

Tests if the last element of the passed input satisfies the given constraint.

Attributes

C

the constraint to test against the last element.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Last

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Last.type
final class Length[C]

Tests if the length of the passed input satisfies the given constraint.

Tests if the length of the passed input satisfies the given constraint.

Attributes

C

the constraint to test on the given input.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Length

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Length.type
final class Tail[C]

Tests if each element except the first one satisfies the given constraint.

Tests if each element except the first one satisfies the given constraint.

Attributes

C

the constraint to test against the tail.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Tail

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Tail.type

Types

type Empty = DescribedAs[Length[StrictEqual[0]], "Should be empty"]

Tests if the input is empty.

Tests if the input is empty.

Attributes

type MaxLength[V <: Int] = DescribedAs[Length[LessEqual[V]], "Should have a maximum length of " + V]

Tests maximum length. Supports Iterable and String by default.

Tests maximum length. Supports Iterable and String by default.

Attributes

V

the maximum length of the tested input

type MinLength[V <: Int] = DescribedAs[Length[GreaterEqual[V]], "Should have a minimum length of " + V]

Tests minimum length. Supports Iterable and String by default.

Tests minimum length. Supports Iterable and String by default.

Attributes

V

the minimum length of the tested input