X Tutup
Skip to content
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

@WonderCsabo

Description

@WonderCsabo

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup