/*
 * 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;

/**
 * @author Alex Usun
 */
@SuppressWarnings("unchecked")
public class Identity<V, R>
        extends UnaryFunction<V, R> {

    /**
     * @param <V> <V>
     * @param <R> <R>
     *
     * @return UnaryFunction instance
     */
    public static <V, R> UnaryFunction<V, R> instance() {
        return new Identity<V, R>();
    }

    /**
     * @param value value
     *
     * @return R instance
     */
    public R evaluate(V value) {
        return (R) value;
    }
}
