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
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 *  Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * 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;

    

Parameters:
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;
    }
    @Override
    public FunctorBase<?, BooleanmakeBase(InvokableState invokableState) {
        return new NullValidatingPredicate(invokableState);
    }
New to GrepCode? Check out our FAQ X