@Test public void testEquals() { SegmentSignature ss = new SegmentSignature("segmentName", 999L); Assert.assertTrue(ss.equals(ss)); Assert.assertFalse(ss.equals(null)); SegmentSignature ss1 = new SegmentSignature("segmentName", 0L); Assert.assertFalse(ss.equals(ss1)); SegmentSignature ss2 = new SegmentSignature(null, 999L); Assert.assertFalse(ss.equals(ss2)); Assert.assertFalse(ss2.equals(ss)); SegmentSignature ss3 = new SegmentSignature("segmentName2", 999L); Assert.assertFalse(ss.equals(ss3)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SegmentSignature that = (SegmentSignature) o; if (lastBuildTime != that.lastBuildTime) return false; return name != null ? name.equals(that.name) : that.name == null; }
SegmentSignature extends ComponentSignature<SegmentSignature> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SegmentSignature that = (SegmentSignature) o; if (lastBuildTime != that.lastBuildTime) return false; return name != null ? name.equals(that.name) : that.name == null; } }
SegmentSignature extends ComponentSignature<SegmentSignature> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SegmentSignature that = (SegmentSignature) o; if (lastBuildTime != that.lastBuildTime) return false; return name != null ? name.equals(that.name) : that.name == null; } SegmentSignature(String name, long lastBuildTime); }
SegmentSignature extends ComponentSignature<SegmentSignature> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SegmentSignature that = (SegmentSignature) o; if (lastBuildTime != that.lastBuildTime) return false; return name != null ? name.equals(that.name) : that.name == null; } SegmentSignature(String name, long lastBuildTime); String getKey(); @Override int compareTo(SegmentSignature o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
SegmentSignature extends ComponentSignature<SegmentSignature> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SegmentSignature that = (SegmentSignature) o; if (lastBuildTime != that.lastBuildTime) return false; return name != null ? name.equals(that.name) : that.name == null; } SegmentSignature(String name, long lastBuildTime); String getKey(); @Override int compareTo(SegmentSignature o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); final String name; final long lastBuildTime; }