public int compareTo()

in api/src/main/java/com/spotify/metrics/core/MetricId.java [321:345]


    public int compareTo(MetricId o) {
        if (o == null) {
            return -1;
        }

        // fast path, same object, or same content.
        if (this == o) {
            return 0;
        }

        // fast path, different hashes.
        final int h = Integer.compare(hash, o.hash);

        if (h != 0) {
            return h;
        }

        final int k = compareKey(key, o.getKey());

        if (k != 0) {
            return k;
        }

        return compareTags(tags.entrySet(), o.tags.entrySet());
    }