// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java
// @EqualsAndHashCode
// @ToString
// public class Quadriple<T, U, V, X> implements Serializable {
//     public final T first;
// 
//     public final U second;
// 
//     public final V third;
// 
//     public final X fourth;
// 
//     public Quadriple(T first, U second, V third, X fourth) {
//         this.first = first;
//         this.second = second;
//         this.third = third;
//         this.fourth = fourth;
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Triple.java
// @EqualsAndHashCode
// @ToString
// public class Triple<T, U, V> implements Serializable {
//     public final T first;
// 
//     public final U second;
// 
//     public final V third;
// 
//     public Triple(T first, U second, V third) {
//         this.first = first;
//         this.second = second;
//         this.third = third;
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Tuple.java
// @EqualsAndHashCode
// @ToString
// public class Tuple<T, U> implements Serializable {
//     public final T first;
// 
//     public final U second;
// 
//     public Tuple(T first, U second) {
//         this.first = first;
//         this.second = second;
//     }
// }


import lombok.experimental.UtilityClass;
import rx.functions.Func2;
import com.pacoworks.dereference.reactive.tuples.Quadriple;
import com.pacoworks.dereference.reactive.tuples.Triple;
import com.pacoworks.dereference.reactive.tuples.Tuple;
/*
 * Copyright (c) pakoito 2015
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.pacoworks.dereference.reactive;



@UtilityClass
public class RxTuples {
    public static <T, U> Func2<T, U, Tuple<T, U>> singleToTuple() {
        return new Func2<T, U, Tuple<T, U>>() {
            @Override
            public Tuple<T, U> call(T first, U second) {
                return new Tuple<>(first, second);
            }
        };
    }

    public static <T, U> Func2<T, U, Tuple<U, T>> singleToTupleInverse() {
        return new Func2<T, U, Tuple<U, T>>() {
            @Override
            public Tuple<U, T> call(T first, U second) {
                return new Tuple<>(second, first);
            }
        };
    }

// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java
// @EqualsAndHashCode
// @ToString
// public class Quadriple<T, U, V, X> implements Serializable {
//     public final T first;
// 
//     public final U second;
// 
//     public final V third;
// 
//     public final X fourth;
// 
//     public Quadriple(T first, U second, V third, X fourth) {
//         this.first = first;
//         this.second = second;
//         this.third = third;
//         this.fourth = fourth;
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Triple.java
// @EqualsAndHashCode
// @ToString
// public class Triple<T, U, V> implements Serializable {
//     public final T first;
// 
//     public final U second;
// 
//     public final V third;
// 
//     public Triple(T first, U second, V third) {
//         this.first = first;
//         this.second = second;
//         this.third = third;
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Tuple.java
// @EqualsAndHashCode
// @ToString
// public class Tuple<T, U> implements Serializable {
//     public final T first;
// 
//     public final U second;
// 
//     public Tuple(T first, U second) {
//         this.first = first;
//         this.second = second;
//     }
// }


// Path: app/src/main/java/com/pacoworks/dereference/reactive/RxTuples.java
import lombok.experimental.UtilityClass;
import rx.functions.Func2;
import com.pacoworks.dereference.reactive.tuples.Quadriple;
import com.pacoworks.dereference.reactive.tuples.Triple;
import com.pacoworks.dereference.reactive.tuples.Tuple;

/*
 * Copyright (c) pakoito 2015
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.pacoworks.dereference.reactive;



@UtilityClass
public class RxTuples {
    public static <T, U> Func2<T, U, Tuple<T, U>> singleToTuple() {
        return new Func2<T, U, Tuple<T, U>>() {
            @Override
            public Tuple<T, U> call(T first, U second) {
                return new Tuple<>(first, second);
            }
        };
    }

    public static <T, U> Func2<T, U, Tuple<U, T>> singleToTupleInverse() {
        return new Func2<T, U, Tuple<U, T>>() {
            @Override
            public Tuple<U, T> call(T first, U second) {
                return new Tuple<>(second, first);
            }
        };
    }

    public static <T, U, V> Func2<T, Tuple<U, V>, Triple<T, U, V>> singleToTriple() {