# Validator

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:  

# Validator

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/service/autofill/Validator "View this page in Kotlin")\|Java

`
public


interface
Validator
`  
`


`

|------------------------------------|
| android.service.autofill.Validator |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [LuhnChecksumValidator](https://developer.android.com/reference/android/service/autofill/LuhnChecksumValidator),[RegexValidator](https://developer.android.com/reference/android/service/autofill/RegexValidator) |-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------| | [LuhnChecksumValidator](https://developer.android.com/reference/android/service/autofill/LuhnChecksumValidator) | Validator that returns`true`if the number created by concatenating all given fields pass a Luhn algorithm checksum. | | [RegexValidator](https://developer.android.com/reference/android/service/autofill/RegexValidator)               | Defines if a field is valid based on a regular expression (regex).                                                  | |

<br />

*** ** * ** ***

Class used to define whether a condition is satisfied.

Typically used to avoid displaying the save UI when the user input is invalid.