@Test public void testInEqualityWithNamespace() throws Exception { QualifiedPathKey key1 = new QualifiedPathKey(cluster1, path1, namespace1); QualifiedPathKey key2 = new QualifiedPathKey(cluster1, path1, namespace2); assertEquals(key1.compareTo(key2), -1); }
@Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .append(this.namespace, otherKey.getNamespace()) .toComparison(); } else { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .toComparison(); } }
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .append(this.namespace, otherKey.getNamespace()) .toComparison(); } else { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .toComparison(); } } }
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .append(this.namespace, otherKey.getNamespace()) .toComparison(); } else { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .toComparison(); } } QualifiedPathKey(String cluster, String path);  QualifiedPathKey(String cluster, String path, String namespace); }
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .append(this.namespace, otherKey.getNamespace()) .toComparison(); } else { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .toComparison(); } } QualifiedPathKey(String cluster, String path);  QualifiedPathKey(String cluster, String path, String namespace); String getCluster(); String getPath(); String getNamespace(); @Override String toString(); @Override int compareTo(Object other); @Override int hashCode(); @Override boolean equals(Object other); boolean hasFederatedNS(); }
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .append(this.namespace, otherKey.getNamespace()) .toComparison(); } else { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .toComparison(); } } QualifiedPathKey(String cluster, String path);  QualifiedPathKey(String cluster, String path, String namespace); String getCluster(); String getPath(); String getNamespace(); @Override String toString(); @Override int compareTo(Object other); @Override int hashCode(); @Override boolean equals(Object other); boolean hasFederatedNS();  }