Code example for Predicate

Methods: apply

0
    public final T createInstance() 
    { 
        try 
        { 
            T instance = defaultFactory.createInstance();
            if (verifier.apply(instance))
            { 
                return instance;
            } 
 
            logger.warn(failureMessage, "(false from predicate)");
            return fallbackFactory.createInstance();
        } 
        catch (Throwable t)
        { 
            if (logger.isDebugEnabled()) 
                logger.warn(failureMessage, t.toString() + "\n" + Throwables.getStackTraceAsString(t));
            else 
                logger.warn(failureMessage, t.toString());