kpug / fpij

functional programming in java
0 stars 0 forks source link

3.2.1 Cleaning up the code #4

Open pr-lawrence opened 7 years ago

pr-lawrence commented 7 years ago
static Executable validate(String s) {
    Result result = emailChecker.apply(s);

    return (result instanceof Result.Success)
            ? () -> sendVerificationMail(s)
            : () -> logError(((Result.Failure)result).getMessage());
}
? ()
: ()