Validator

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Validator(val validWhen: String = "")

The @Validator annotation is applied to those methods which are used to check the validity of an input, and it is useful to provide additional information about the annotated method such the validity case of the input checked

Example usage:

@Validator(
    validWhen = "The input is valid when is not null" // not mandatory
)
fun inputValid(
    input: Any?
) : Boolean {
    return input != null
}

Author

N7ghtm4r3 - Tecknobit

Since

1.0.9

Properties

Link copied to clipboard