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

Allow setting a validator class for an option. #37

Open
jarrodhroberson opened this issue Aug 20, 2015 · 0 comments
Open

Allow setting a validator class for an option. #37

jarrodhroberson opened this issue Aug 20, 2015 · 0 comments

Comments

@jarrodhroberson
Copy link

I would like to register a class to apply to the value of an option.

Implementations of the following interface would allow extremely flexible pre-validation without having to add this noise to your code and would allow better reuse of common validations.

public interface OptionValidator<T>
{
    public boolean isValid(@Nullable final T value);
    @Nonnull
    public String getErrorMessage();
}

If you could point me to where this should be added in I can write it and submit a pull request, but the indirection is obfuscating where this would go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant