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

org.javers.core.diff.changetype.container.Container Maven / Gradle / Ivy

There is a newer version: 7.6.2
Show newest version
package org.javers.core.diff.changetype.container;

import org.javers.core.diff.changetype.Atomic;

import java.util.Objects;

/**
 * internal wrapper for Collection or Array
 */
class Container {
    private final T value;

    Container(T value) {
        this.value = value;
    }

    public T unwrap() {
        return value;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Container)) {
            return false;
        }

        Container other = (Container)obj;
        return Objects.equals(value, other.value);
    }

    @Override
    public int hashCode() {
        if (value == null) {
            return 0;
        }
        return value.hashCode();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy