Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class ContainsDigits(val value: String) : ValidationError

Input has digits

Link copied to clipboard
data class ContainsLetters(val value: String) : ValidationError

Input has letters

Link copied to clipboard
data class DoesNotContain(val value: String, val needle: String) : ValidationError

Input does not contain a needle

Link copied to clipboard
data class DoesNotEndWith(val value: String, val suffix: String) : ValidationError

Input does not end with suffix

Link copied to clipboard
data class DoesNotMatch(val value: String, val pattern: Regex) : ValidationError

Input does not match the pattern

Link copied to clipboard
data class DoesNotStartWith(val value: String, val prefix: String) : ValidationError

Input does not start with prefix

Link copied to clipboard
value class Empty(val value: String) : ValidationError

The input is blank.

Link copied to clipboard
abstract class Generic(val value: String) : ValidationError

A generic validation error that can be subclassed. In this case, you need to keep track of your custom errors yourself.

Link copied to clipboard
data class HasNoDigits(val value: String) : ValidationError

Input has no digits

Link copied to clipboard
value class HasNoLetters(val value: String) : ValidationError

Input has no letters

Link copied to clipboard
value class HasWhitespace(val value: String) : ValidationError

Input's value has whitespace

Link copied to clipboard
data class IsNotEqual(val value: String, val other: String) : ValidationError

Input's value was not equal to other

Link copied to clipboard
data class LengthIsNotExactly(val value: String, val length: Int) : ValidationError

Length of the input was not exactly length

Link copied to clipboard

Input is not alpha-numeric

Link copied to clipboard
value class NotAscii(val value: String) : ValidationError

Input's value is not an ascii symbol

Link copied to clipboard
value class NotDigitsOnly(val value: String) : ValidationError

Input's value contained anything except digits

Link copied to clipboard
data class NotInRange(val value: String, val range: IntRange) : ValidationError

Length of the input was not in range

Link copied to clipboard

Input's value contained anything except letters.

Link copied to clipboard
value class NotLowercase(val value: String) : ValidationError

Input's value is not lowercase

Link copied to clipboard
value class NotSingleline(val value: String) : ValidationError

Input's value has newlines ('\n')

Link copied to clipboard
value class NotUppercase(val value: String) : ValidationError

Input's value is not uppercase

Link copied to clipboard

Input value has no uppercase letters

Link copied to clipboard
data class TooLong(val value: String, val maxLength: Int) : ValidationError

Input was longer than maxLength

Link copied to clipboard
data class TooShort(val value: String, val minLength: Int) : ValidationError

Input was shorter than minLength

Properties

Link copied to clipboard
abstract val value: String

A value that is being validated