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

com.blade.kit.Tuple2 Maven / Gradle / Ivy

There is a newer version: 2.0.15.RELEASE
Show newest version
package com.blade.kit;

import java.util.Objects;

/**
 * Tuple2
 *
 * @author ccqy66
 */
public class Tuple2 {

    private K k;
    private V v;

    public Tuple2(K k, V v) {
        this.k = k;
        this.v = v;
    }

    public K getK() {
        return k;
    }

    public V getV() {
        return v;
    }

    public K _1() {
        return k;
    }

    public V _2() {
        return v;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Tuple2 tuple2 = (Tuple2) o;
        return Objects.equals(k, tuple2.k) &&
                Objects.equals(v, tuple2.v);
    }

    @Override
    public int hashCode() {
        return Objects.hash(k, v);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy