@Test public void testComparator() { PropertyRegistration A = new PropertyRegistration("Root", "aaa"); PropertyRegistration B = new PropertyRegistration("Root", "bbb"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "aaa"); B = new PropertyRegistration("Root", "bbb"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "bbb"); B = new PropertyRegistration("Root", "aaa"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("Root", "bbb", "Inner1", "Inner2"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "bbb", "Inner1", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa"); B = new PropertyRegistration("Root", "aaa"); assertTrue(A.compareTo(B) == 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); assertTrue(A.compareTo(B) == 0); A = new PropertyRegistration("Root", "aaa"); B = new PropertyRegistration("Soot", "aaa"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Soot", "aaa"); B = new PropertyRegistration("Root", "aaa"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("aaa.Root", "aaa"); B = new PropertyRegistration("zzz.Root", "aaa"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("zzz.Root", "aaa"); B = new PropertyRegistration("aaa.Root", "aaa"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("aaa.Root", "aaa"); B = new PropertyRegistration("Root", "aaa"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa"); B = new PropertyRegistration("aaa.Root", "aaa"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("aaa.bbb.Root", "aaa"); B = new PropertyRegistration("aaa.Root", "aaa"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("aaa.Root", "aaa"); B = new PropertyRegistration("aaa.bbb.Root", "aaa"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1"); B = new PropertyRegistration("Root", "aaa", "Inner2"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner1"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner0", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner0", "Inner2"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner1"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); B = new PropertyRegistration("Root", "aaa", "Inner1"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); assertTrue(A.compareTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); B = new PropertyRegistration("Root", "aaa", "Inner2"); assertTrue(A.compareTo(B) < 0); A = new PropertyRegistration("org.yat.MyClass", "Evan", "Inner1", "Inner2"); B = new PropertyRegistration("org.yat.MyClass", "George", "Inner3"); assertTrue(A.compareTo(B) < 0); }
@Override public int compareTo(PropertyRegistration o) { int comp = compareRootTo(o); if (comp != 0) { return comp; } comp = compareInnerPathTo(o); if (comp != 0) { return comp; } return getPropertyName().compareTo(o.getPropertyName()); }
PropertyRegistration implements Comparable<PropertyRegistration> { @Override public int compareTo(PropertyRegistration o) { int comp = compareRootTo(o); if (comp != 0) { return comp; } comp = compareInnerPathTo(o); if (comp != 0) { return comp; } return getPropertyName().compareTo(o.getPropertyName()); } }
PropertyRegistration implements Comparable<PropertyRegistration> { @Override public int compareTo(PropertyRegistration o) { int comp = compareRootTo(o); if (comp != 0) { return comp; } comp = compareInnerPathTo(o); if (comp != 0) { return comp; } return getPropertyName().compareTo(o.getPropertyName()); } PropertyRegistration(String classCanonName, String propName);   PropertyRegistration(String classCanonName, String propName, String... innerPathNesting); }
PropertyRegistration implements Comparable<PropertyRegistration> { @Override public int compareTo(PropertyRegistration o) { int comp = compareRootTo(o); if (comp != 0) { return comp; } comp = compareInnerPathTo(o); if (comp != 0) { return comp; } return getPropertyName().compareTo(o.getPropertyName()); } PropertyRegistration(String classCanonName, String propName);   PropertyRegistration(String classCanonName, String propName, String... innerPathNesting); String getCanonicalRootName(); String getPropertyName(); String[] getInnerPath(); int getInnerPathLength(); String getCanonicalPropertyName(); String getJavaCanonicalParentName(); String getCanonicalParentName(); int compareRootTo(PropertyRegistration o); int compareInnerPathTo(PropertyRegistration o); @Override int compareTo(PropertyRegistration o); }
PropertyRegistration implements Comparable<PropertyRegistration> { @Override public int compareTo(PropertyRegistration o) { int comp = compareRootTo(o); if (comp != 0) { return comp; } comp = compareInnerPathTo(o); if (comp != 0) { return comp; } return getPropertyName().compareTo(o.getPropertyName()); } PropertyRegistration(String classCanonName, String propName);   PropertyRegistration(String classCanonName, String propName, String... innerPathNesting); String getCanonicalRootName(); String getPropertyName(); String[] getInnerPath(); int getInnerPathLength(); String getCanonicalPropertyName(); String getJavaCanonicalParentName(); String getCanonicalParentName(); int compareRootTo(PropertyRegistration o); int compareInnerPathTo(PropertyRegistration o); @Override int compareTo(PropertyRegistration o);  }