@Test public void compareTo_identical() { final DevicePattern a = new Blueprint().build(); final DevicePattern b = new Blueprint().build(); assertThat(a.compareTo(b) == 0).isTrue(); }
@Override public int compareTo(final DevicePattern other) { int result = other == null ? -1 : 0; if (result == 0) { result = compareInt(getPosition(), other.getPosition()); if (result == 0) { result = compareInt(getId(), other.getId()); } if (result == 0) { result = getPattern().pattern().compareTo(other.getPattern().pattern()); } if (result == 0) { result = compareInt(getPattern().flags(), other.getPattern().flags()); } } return result; }
DevicePattern implements Identifiable, OrderedPattern<DevicePattern>, Serializable { @Override public int compareTo(final DevicePattern other) { int result = other == null ? -1 : 0; if (result == 0) { result = compareInt(getPosition(), other.getPosition()); if (result == 0) { result = compareInt(getId(), other.getId()); } if (result == 0) { result = getPattern().pattern().compareTo(other.getPattern().pattern()); } if (result == 0) { result = compareInt(getPattern().flags(), other.getPattern().flags()); } } return result; } }
DevicePattern implements Identifiable, OrderedPattern<DevicePattern>, Serializable { @Override public int compareTo(final DevicePattern other) { int result = other == null ? -1 : 0; if (result == 0) { result = compareInt(getPosition(), other.getPosition()); if (result == 0) { result = compareInt(getId(), other.getId()); } if (result == 0) { result = getPattern().pattern().compareTo(other.getPattern().pattern()); } if (result == 0) { result = compareInt(getPattern().flags(), other.getPattern().flags()); } } return result; } DevicePattern(@Nonnegative final int id, @Nonnull final Pattern pattern, @Nonnegative final int position); }
DevicePattern implements Identifiable, OrderedPattern<DevicePattern>, Serializable { @Override public int compareTo(final DevicePattern other) { int result = other == null ? -1 : 0; if (result == 0) { result = compareInt(getPosition(), other.getPosition()); if (result == 0) { result = compareInt(getId(), other.getId()); } if (result == 0) { result = getPattern().pattern().compareTo(other.getPattern().pattern()); } if (result == 0) { result = compareInt(getPattern().flags(), other.getPattern().flags()); } } return result; } DevicePattern(@Nonnegative final int id, @Nonnull final Pattern pattern, @Nonnegative final int position); @Override int compareTo(final DevicePattern other); @Override boolean equals(final Object obj); @Override int getId(); @Override Pattern getPattern(); @Override int getPosition(); @Override int hashCode(); @Override String toString(); }
DevicePattern implements Identifiable, OrderedPattern<DevicePattern>, Serializable { @Override public int compareTo(final DevicePattern other) { int result = other == null ? -1 : 0; if (result == 0) { result = compareInt(getPosition(), other.getPosition()); if (result == 0) { result = compareInt(getId(), other.getId()); } if (result == 0) { result = getPattern().pattern().compareTo(other.getPattern().pattern()); } if (result == 0) { result = compareInt(getPattern().flags(), other.getPattern().flags()); } } return result; } DevicePattern(@Nonnegative final int id, @Nonnull final Pattern pattern, @Nonnegative final int position); @Override int compareTo(final DevicePattern other); @Override boolean equals(final Object obj); @Override int getId(); @Override Pattern getPattern(); @Override int getPosition(); @Override int hashCode(); @Override String toString();  }