@Test public void sort3() throws IOException { Profile one = ProfileUtil.readAllFromClasspath("order-test-1", "").get(0);; Profile two = ProfileUtil.fromYaml(getClass().getResourceAsStream("/fabric8/config/ProfileTest.yml")).get(0); assertTrue(one.compareTo(two) < 0); assertTrue(two.compareTo(one) > 0); }
@Override public int compareTo(Profile o) { int orderDiff = order - o.order; if (orderDiff != 0) { return orderDiff; } else { return this.id - o.id; } }
Profile implements Comparable<Profile> { @Override public int compareTo(Profile o) { int orderDiff = order - o.order; if (orderDiff != 0) { return orderDiff; } else { return this.id - o.id; } } }
Profile implements Comparable<Profile> { @Override public int compareTo(Profile o) { int orderDiff = order - o.order; if (orderDiff != 0) { return orderDiff; } else { return this.id - o.id; } } Profile();  Profile(Profile profile);  Profile(Profile profileA, Profile profileB); }
Profile implements Comparable<Profile> { @Override public int compareTo(Profile o) { int orderDiff = order - o.order; if (orderDiff != 0) { return orderDiff; } else { return this.id - o.id; } } Profile();  Profile(Profile profile);  Profile(Profile profileA, Profile profileB); String getName(); String getParentProfile(); ProcessorConfig getEnricherConfig(); ProcessorConfig getGeneratorConfig(); ProcessorConfig getWatcherConfig(); void setEnricherConfig(ProcessorConfig config); void setGeneratorConfig(ProcessorConfig config); void setWatcherConfig(ProcessorConfig config); int getOrder(); @Override // Higher order means "larger" int compareTo(Profile o); }
Profile implements Comparable<Profile> { @Override public int compareTo(Profile o) { int orderDiff = order - o.order; if (orderDiff != 0) { return orderDiff; } else { return this.id - o.id; } } Profile();  Profile(Profile profile);  Profile(Profile profileA, Profile profileB); String getName(); String getParentProfile(); ProcessorConfig getEnricherConfig(); ProcessorConfig getGeneratorConfig(); ProcessorConfig getWatcherConfig(); void setEnricherConfig(ProcessorConfig config); void setGeneratorConfig(ProcessorConfig config); void setWatcherConfig(ProcessorConfig config); int getOrder(); @Override // Higher order means "larger" int compareTo(Profile o);  }