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

jpaoletti.jpm.util.KeyValue Maven / Gradle / Ivy

The newest version!
package jpaoletti.jpm.util;

/**
 *
 * @author jpaoletti
 */
public class KeyValue {

    private Object key;
    private Object value;

    public KeyValue(Object key, Object value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final KeyValue other = (KeyValue) obj;
        if (this.key != other.key && (this.key == null || !this.key.equals(other.key))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 23 * hash + (this.key != null ? this.key.hashCode() : 0);
        return hash;
    }

    public Object getKey() {
        return key;
    }

    public void setKey(Object key) {
        this.key = key;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy