All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.liftweb.common.Func Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2011 WorldWide Conferencing, LLC
 *
 * 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 net.liftweb.common;

import scala.*;

import java.util.concurrent.Callable;

/**
 * The bridge from various arity FuncX to
 * Scala's function instances
 */
public final class Func {
    private static final FuncJBridge bridge = new FuncJBridge();

    /**
     * Lift a Java Func0 to a Scala Function0
     *
     * @param f the function to lift
     *
     * @returns the Scala function
     */
    public static Function0 lift(Func0 f) {
	return bridge.lift(f);
    }

    /**
     * Lift a Java Func1 to a Scala Function1
     *
     * @param f the function to lift
     *
     * @returns the Scala function
     */
    public static Function1 lift(Func1 f) {
	return bridge.lift(f);
    }

    /**
     * Lift a Java Func2 to a Scala Function2
     *
     * @param f the function to lift
     *
     * @returns the Scala function
     */
    public static Function2 lift(Func2 f) {
	return bridge.lift(f);
    }

    /**
     * Lift a Java Func3 to a Scala Function3
     *
     * @param f the function to lift
     *
     * @returns the Scala function
     */
    public static Function3 lift(Func3 f) {
	return bridge.lift(f);
    }

    /**
     * Lift a Java Func4 to a Scala Function4
     *
     * @param f the function to lift
     *
     * @returns the Scala function
     */
    public static Function4 lift(Func4 f) {
	return bridge.lift(f);
    }

    /**
     * Lift a Java Callable to a Scala Function0
     *
     * @param f the function to lift
     *
     * @returns the Scala function
     */
    public static Function0 lift(Callable f) {
	return bridge.lift(f);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy