Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

ValidatorParameterHelper fluent API #1284

Copy link
Copy link
@WonderCsabo

Description

@WonderCsabo
Issue body actions

While i was thinking about implementing #1162 (comment) for @PrefChange, i realized it it is not easy to implement with existing ValidatorParameterHelper code. Then completely refactoring the class into a fluent API came into my mind. So we can write validations like this:

validator.param.inOrder().required().type(STRING).optional().type(INTEGER).validate(isValid);

validator.param.anyOrder().required().extends(VIEW).optional().type(BOOLEAN).validate(isValid);

I think this covers any possibilities, and with this all pamater validation can be handled by calling one method chain (for example an additional zeroOrOneParameter() call is not needed).

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.