public boolean equals()

in api/src/main/java/com/spotify/metrics/core/MetricId.java [283:318]


    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (this == obj) {
            return true;
        }

        if (obj.getClass() != MetricId.class) {
            return false;
        }

        final MetricId m = ((MetricId) obj);

        // different hashes, fastest discriminator.
        if (hash != m.hash) {
            return false;
        }

        if (key == null || m.key == null) {
            if (key != m.key) {
                return false;
            }
        } else {
            if (!key.equals(m.key)) {
                return false;
            }
        }

        if (!tags.equals(m.tags)) {
            return false;
        }

        return true;
    }