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

io.descoped.dc.api.handler.Tuple Maven / Gradle / Ivy

The newest version!
package io.descoped.dc.api.handler;

import java.util.Objects;

public class Tuple {

    final K key;
    final V value;

    public Tuple(K key, V value) {
        this.key = key;
        this.value = value;
    }

    public K getKey() {
        return key;
    }

    public V getValue() {
        return value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Tuple)) return false;
        Tuple tuple = (Tuple) o;
        return Objects.equals(key, tuple.key) &&
                Objects.equals(value, tuple.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, value);
    }

    @Override
    public String toString() {
        return "Tuple{" +
                "key=" + key +
                ", value=" + value +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy