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

org.broadinstitute.hellbender.utils.KV Maven / Gradle / Ivy

The newest version!
package org.broadinstitute.hellbender.utils;

import java.util.Objects;

/**
 * replacement for dataflow Key-Value class, don't use this anywhere new
 */
public class KV {

    private final K key;
    private final V value;

    public static   KV of(K key, V value){
        return new KV<>(key, value);
    }

    private KV(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 == null || getClass() != o.getClass()) return false;
        KV kv = (KV) o;
        return Objects.equals(key, kv.key) &&
                Objects.equals(value, kv.value);
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy