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

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

Activity

  1. WonderCsabo commented on Dec 23, 2014

    @WonderCsabo
    MemberAuthor

    @yDelouis @dodgex @DayS i would like to implement this, but please let's discuss the feature, is it needed at all and what should be the exact design if it is?

  2. yDelouis commented on Dec 25, 2014

    @yDelouis
    Contributor

    It would be great.
    Please, note that I changed a bit the validation in my plugin branch so that it is simpler. There is nothing complicated but it will be hard to maintain the two branches if they are divergent.

  3. WonderCsabo commented on Dec 25, 2014

    @WonderCsabo
    MemberAuthor

    I think we should merge these big changes ASAP, because maintaining them is not easy. Currently there are 3 big PRs which change the whole codebase: #1226, #1280, #1198 and plugins.

  4. self-assigned this
    on Feb 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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