Skip to content

String Rules

Alexandre DuBreuil edited this page Aug 22, 2018 · 2 revisions

Documentation

See javadoc for StringCondition.

Usage

The field accountEmail is of type StringFieldInfo that delegates the validation to StringCondition.

package io.doov.sample.validation;

import static io.doov.sample.field.dsl.DslSampleModel.accountAccepted;

public interface SampleRules {

    // Validates email is accepted
    ValidationRule RULE_EMAIL = DslModel
        .when(accountEmail.matches("\\w+[@]\\w+\\.com"))
        .validate();

}