Skip to content

Validator[T: T]

[Source]

Interface validators must implement.

We strongly suggest you use a primitive for your Validator as validators are required to be stateless.

interface val Validator[T: T]

Constructors

create

[Source]

new val create()
: Validator[T] val^

Returns


Public Functions

apply

[Source]

Takes an instance and returns either ValidationSuccess if it meets the constraint criteria or ValidationFailure if it doesn't.

fun box apply(
  i: T)
: (ValidationSuccess val | ValidationFailure val)

Parameters

  • i: T

Returns