Exit Full View

Feather2 / feather2-runtime / src / main / java / uk / co / nickthecoder / feather / runtime / FPair.java

package uk.co.nickthecoder.feather.runtime;

import java.util.Objects;

final public class FPair<F, S> {

    public FPair(F first, S second) {
        this.first = first;
        this.second = second;
    }

    final F first;
    final S second;

    @Override
    public boolean equals(Object other) {
        if (other instanceof FPair) {
            FPair<?, ?> o = (FPair<?, ?>) other;
            return Objects.equals(this.first, o.first) && Objects.equals(this.second, o.second);
        }
        return false;
    }

    @Override
    public String toString() {
        return "FPair(" + first + "," + second + ")";
    }
}