VgsTextLengthValidator

class VgsTextLengthValidator(val lengths: IntArray, val errorMsg: String = ERROR_MESSAGE) : VgsTextFieldValidator

Validator that requires the value's length to match one of the allowed lengths.

Useful for fixed-length identifiers (e.g. arrayOf(9) for SSN, arrayOf(15, 16) for card numbers).

Parameters

lengths

the set of accepted character counts.

errorMsg

message returned when the length is not in lengths.

Constructors

Link copied to clipboard
constructor(lengths: IntArray, errorMsg: String = ERROR_MESSAGE)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Result(val isValid: Boolean, val errorMsg: String? = null) : VgsTextFieldValidationResult

Properties

Link copied to clipboard
open override val errorMsg: String
Link copied to clipboard