Teki
Rules

Rules Overview

Browse Teki's built-in builders, presence rules, string rules, and range rules.

Import the builder entry points from Rules when using the fluent API:

import static dev.ditsche.teki.rule.builder.Rules.*;

Rules are organized around the shape of the field first, then the constraints you add to that field.

Builders

Presence and normalization

String validation

Size and range

Temporal

Example

Teki schema = Teki.fromRules(
    string("email").required().email().trim(),
    string("username").required().alphanum().min(3).max(24),
    number("age").min(13),
    array("roles").elements().string().min(2).max(32)
);

On this page