Input Validator

open class InputValidator

The InputValidator class is useful to validate the inputs

Author

N7ghtm4r3 - Tecknobit

Since

1.0.1

Constructors

Link copied to clipboard
protected constructor()
Constructor to init the InputValidator class No-any params required

Properties

Link copied to clipboard
DEFAULT_LANGUAGE default language used
Link copied to clipboard
EMAIL_MAX_LENGTH the max valid length for the email
Link copied to clipboard
protected val emailValidator: EmailValidator
emailValidator helper to validate the emails values
Link copied to clipboard
val HOST_ADDRESS_KEY: String = "host_address"
HOST_ADDRESS_KEY the key for the "host_address" field
Link copied to clipboard
LANGUAGES_SUPPORTED list of the supported languages
Link copied to clipboard
MAX_REVENUE_LABELS_NUMBER_LENGTH the max valid number of labels for revenue
Link copied to clipboard
NAME_MAX_LENGTH the max valid length for the username
Link copied to clipboard
PASSWORD_MAX_LENGTH the max valid length for the password
Link copied to clipboard
PASSWORD_MIN_LENGTH the min valid length for the password
Link copied to clipboard
REVENUE_DESCRIPTION_MAX_LENGTH the max valid length for the revenue description
Link copied to clipboard
REVENUE_TITLE_MAX_LENGTH the max valid length for the revenue title
Link copied to clipboard
SURNAME_MAX_LENGTH the max valid length for the surname
Link copied to clipboard
protected val urlValidator: UrlValidator
urlValidator helper to validate the urls values
Link copied to clipboard
val WRONG_CURRENCY_MESSAGE: String = "wrong_currency_key"
WRONG_CURRENCY_MESSAGE error message used when the currency inserted is not valid
Link copied to clipboard
val WRONG_EMAIL_MESSAGE: String = "wrong_email_key"
WRONG_EMAIL_MESSAGE error message used when the email inserted is not valid
Link copied to clipboard
val WRONG_LANGUAGE_MESSAGE: String = "wrong_language_key"
WRONG_LANGUAGE_MESSAGE error message used when the language inserted is not valid
Link copied to clipboard
val WRONG_NAME_MESSAGE: String = "wrong_name_key"
WRONG_NAME_MESSAGE error message used when the name inserted is not valid
Link copied to clipboard
val WRONG_PASSWORD_MESSAGE: String = "wrong_password_key"
WRONG_PASSWORD_MESSAGE error message used when the password inserted is not valid
Link copied to clipboard
val WRONG_SURNAME_MESSAGE: String = "wrong_surname_key"
WRONG_SURNAME_MESSAGE error message used when the surname inserted is not valid

Functions

Link copied to clipboard
open fun isEmailValid(email: String): Boolean
Method to validate an email
Link copied to clipboard
open fun isHostValid(host: String): Boolean
Method to validate a host
Link copied to clipboard
protected open fun isInputValid(field: String): Boolean
Method to validate an input
Link copied to clipboard
open fun isLanguageValid(language: String): Boolean
Method to validate a language
Link copied to clipboard
open fun isNameValid(name: String): Boolean
Method to validate a name
Link copied to clipboard
open fun isPasswordValid(password: String): Boolean
Method to validate a password
Link copied to clipboard
open fun isServerSecretValid(serverSecret: String): Boolean
Method to validate a server secret
Link copied to clipboard
open fun isSurnameValid(surname: String): Boolean
Method to validate a surname