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

net.dongliu.commons.collection.TupleUtils Maven / Gradle / Ivy

The newest version!
package net.dongliu.commons.collection;

import net.dongliu.commons.collection.*;

/**
 * utils method for tuple
 *
 * @author Dong Liu [email protected]
 */
public class TupleUtils {

    /**
     * create tuple2
     */
    public static  Tuple2 of(A a, B b) {
        return new Tuple2<>(a, b);
    }

    /**
     * create tuple3
     */
    public static  Tuple3 of(A a, B b, C c) {
        return new Tuple3<>(a, b, c);
    }

    /**
     * create tuple4
     */
    public static  Tuple4 of(A a, B b, C c, D d) {
        return new Tuple4<>(a, b, c, d);
    }

    /**
     * create tuple5
     */
    public static  Tuple5 of(A a, B b, C c, D d, E e) {
        return new Tuple5<>(a, b, c, d, e);
    }

    /**
     * create tuple6
     */
    public static  Tuple6 of(A a, B b, C c, D d, E e, F f) {
        return new Tuple6<>(a, b, c, d, e, f);
    }

    /**
     * create tuple7
     */
    public static  Tuple7 of(A a, B b, C c, D d, E e,
                                                                       F f, G g) {
        return new Tuple7<>(a, b, c, d, e, f, g);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy