/*
 * Copyright (c) 2009 JSCAPE
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JSCAPE.
 *
 */

package com.jscape.util.functor.adapters;

import com.jscape.util.functor.Function;
import com.jscape.util.functor.Predicate;

/**
 * @author Alex Usun
 */
public class PredicateFunction
        implements Function<Boolean> {

    private Predicate base;

    /**
     * @param base base
     *
     * @return Function instance
     */
    public static Function<Boolean> adapt(Predicate base) {
        return new PredicateFunction(base);
    }

    /**
     * @param base base
     */
    public PredicateFunction(Predicate base) {
        this.base = base;
    }

    /**
     * @return Boolean instance
     */
    public Boolean evaluate() {
        return this.base.evaluate();
    }
}