ValidateIf

@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class ValidateIf(val field: String, val equals: String = "")

Specifies a conditional check determining whether constraints on the annotated property should be evaluated.

Constraints on the annotated property are evaluated ONLY if property field on the target object equals equals.

Properties

Link copied to clipboard

The string representation of the value required to trigger validation.

Link copied to clipboard

The sibling property name to inspect.