Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2013 Project Funcito Contributors
  *  Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 *  Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.funcito.mode;
This mode is internally used by Funcito for 3rd party APIs with primitive boolean-returning predicates, returning a NullValidatingPredicate that will help diagnose execution problems rather than simply throwing NullPointerException deep in the Funcito internals. It is unlikely that Funcito users will explicitly use this mode but rather only implicitly through special predicate factory methods.

public class ValidateNullBoolean implements Mode {
    private Class<?> apiPredicateClass;
    private Method altMethod;


apiPredicateClass 3rd party predicate class that is using this, provided here to make diagnostic failure messages more meaningful.
altMethod recommended alternative factory method, provided here to also enhance diagnostic falure messages
    public ValidateNullBoolean(Class<?> apiPredicateClassMethod altMethod) {
        this. = apiPredicateClass;
        this. = altMethod;
    public FunctorBase<?, BooleanmakeBase(InvokableState invokableState) {
        return new NullValidatingPredicate(invokableState);
New to GrepCode? Check out our FAQ X