Class Fallible<T>


  • public class Fallible<T>
    extends Object

    Monad-style Wrapper class to be used for condition based execution flows. Intended for use in validation-style flows.

    Usage examples
       
      List errors = Fallible.of("")
               .ensure(this::mayNotContainNaughtyWords, d -> b -> b.errorCode("NAUGHTY_ERROR"))
               .ensure(StringUtils::isNotBlank, d -> b -> b.errorCode("MUST_BE_FILLED_IN"))
               .ensure(StringUtils::isMixedCase, d -> b -> b.errorCode("MUST_BE_MIXED_CASE"))
               .failures();
       
     
    Since:
    1.0.0
    Version:
    1.0.0
    Author:
    Stijn Dejongh