Skip to content

Add CustomVerifier#and & CustomVerifier#andComparable methods to allow even more fluid chaining#22

Merged
neocotic merged 1 commit intodevelopfrom
and-then
Feb 11, 2017
Merged

Add CustomVerifier#and & CustomVerifier#andComparable methods to allow even more fluid chaining#22
neocotic merged 1 commit intodevelopfrom
and-then

Conversation

@neocotic
Copy link
Copy Markdown
Member

This PR adds complimentary methods for Verifier#verify and Verifier#verifyComparable to CustomVerifer as and and andComparable to make chaining more fluid. Here's the example from the README:

package com.example.form;

import io.skelp.verifier.Verifier;

public class LoginForm implements Form {

    UserService userService;

    @Override
    public void handle(Map<String, String> data) {
        Verifier.verify(data)
            .containAllKeys("username", "password");
            .and(data.get("username"), "username")
                .not().blank();
            .and(data.get("password"), "password")
                .not().empty()
                .alphanumeric();

        userService.login(data);
    }
}

…ify & verifyComparable methods on Verifier while using a partial copy of the current Verification
@neocotic neocotic added this to the 0.2.0 milestone Feb 11, 2017
@neocotic neocotic self-assigned this Feb 11, 2017
@neocotic neocotic merged commit a48388f into develop Feb 11, 2017
@neocotic neocotic deleted the and-then branch February 11, 2017 02:01
@neocotic neocotic mentioned this pull request Feb 11, 2017
15 tasks
neocotic added a commit that referenced this pull request Feb 11, 2017
* java8 is now the minimum supported version since java7 is post-LTS

* bump to 0.2.0-SNAPSHOT

* Merge branch 'develop' into java8

* improved handling of multi-dimensional arrays and circular references in DefaultArrayFormatter

* Support different locales (#11)

* added initial support for multiple locales

* attempting to fix broken build

* added initial support for multiple verification reporters (#14)

* added assignableFromAll and assignableFromAny methods to ClassVerifier (#15)

* Rename ClassVerifier#interfacing to ClassVerifier#interfaced (#16)

* renamed interfacing method in ClassVerifier to interfaced

* corrected error message for interfaced method on ClassVerifier

* renamed defaulting method in LocaleVerifier to defaulted (#17)

* added matchAll and matchAny methods to StringVerifier (#18)

* added causedByAll and causedByAny methods to ThrowableVerifier (#19)

* updated copyright year throughout

* Update Crowdin configuration file

* added more Formatters and simplified Verification API (#21)

* added and & andComparable methods to CustomVerifier to compliment verify & verifyComparable methods on Verifier while using a partial copy of the current Verification (#22)

* added crowdin badge to README

* added JavaDoc badge to README

* configured Codecov and added badge to README

* added changelog

* roll 0.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant