Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new type of builder to create an ArgumentValidator easily #367

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

making
Copy link
Owner

@making making commented Mar 29, 2024

Arguments3Validator<String, String, Integer, Car> validator = Yavi.arguments()
	._string("manufacturer", c -> c.notNull())
	._string("licensePlate", c -> c.notNull().greaterThanOrEqual(2).lessThanOrEqual(14))
	._integer("seatCount", c -> c.greaterThanOrEqual(2))
	.apply(Car::new);

Validated<Car> validated = validator.validate("foo", "bar", 3);

// or

Car car = validator.validated("foo", "bar", 3);

@making making merged commit f0ba625 into develop Mar 29, 2024
5 checks passed
@making making deleted the chained-builder branch March 29, 2024 17:20
@making making added this to the 0.14.0 milestone Mar 31, 2024
@making making added the enhancement New feature or request label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant