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

org.simpleflatmapper.map.context.impl.MultiValueKey Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 9.0.2
Show newest version
package org.simpleflatmapper.map.context.impl;

import org.simpleflatmapper.map.context.Key;

import java.util.Arrays;

public final class MultiValueKey extends Key {

    private final Object[] values;
    private final int _hashCode;

    public MultiValueKey(Object[] values) {
        this.values = values;
        this._hashCode = Arrays.deepHashCode(values);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MultiValueKey keys = (MultiValueKey) o;
        return Arrays.deepEquals(values, keys.values);
    }

    @Override
    public int hashCode() {
        return _hashCode;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy