@Test public void equals_identical() { final DevicePattern a = new Blueprint().build(); final DevicePattern b = new Blueprint().build(); assertThat(b).isEqualTo(a); assertThat(a.hashCode() == b.hashCode()).isTrue(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + id; result = prime * result + position; result = prime * result + pattern.pattern().hashCode(); result = prime * result + pattern.flags(); return result; }
DevicePattern implements Identifiable, OrderedPattern<DevicePattern>, Serializable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + id; result = prime * result + position; result = prime * result + pattern.pattern().hashCode(); result = prime * result + pattern.flags(); return result; } }
DevicePattern implements Identifiable, OrderedPattern<DevicePattern>, Serializable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + id; result = prime * result + position; result = prime * result + pattern.pattern().hashCode(); result = prime * result + pattern.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 hashCode() { final int prime = 31; int result = 1; result = prime * result + id; result = prime * result + position; result = prime * result + pattern.pattern().hashCode(); result = prime * result + pattern.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 hashCode() { final int prime = 31; int result = 1; result = prime * result + id; result = prime * result + position; result = prime * result + pattern.pattern().hashCode(); result = prime * result + pattern.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();  }