@Test public void testEquals() { FlumeEventPointer pointerA = new FlumeEventPointer(1, 1); FlumeEventPointer pointerB = new FlumeEventPointer(1, 1); Assert.assertEquals(pointerA, pointerB); Assert.assertEquals(pointerB, pointerA); pointerA = new FlumeEventPointer(1, 1); pointerB = new FlumeEventPointer(2, 2); Assert.assertFalse(pointerA.equals(pointerB)); Assert.assertFalse(pointerB.equals(pointerA)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FlumeEventPointer other = (FlumeEventPointer) obj; if (fileID != other.fileID) { return false; } if (offset != other.offset) { return false; } return true; }
FlumeEventPointer { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FlumeEventPointer other = (FlumeEventPointer) obj; if (fileID != other.fileID) { return false; } if (offset != other.offset) { return false; } return true; } }
FlumeEventPointer { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FlumeEventPointer other = (FlumeEventPointer) obj; if (fileID != other.fileID) { return false; } if (offset != other.offset) { return false; } return true; } FlumeEventPointer(int fileID, int offset); }
FlumeEventPointer { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FlumeEventPointer other = (FlumeEventPointer) obj; if (fileID != other.fileID) { return false; } if (offset != other.offset) { return false; } return true; } FlumeEventPointer(int fileID, int offset); long toLong(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static FlumeEventPointer fromLong(long value); }
FlumeEventPointer { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FlumeEventPointer other = (FlumeEventPointer) obj; if (fileID != other.fileID) { return false; } if (offset != other.offset) { return false; } return true; } FlumeEventPointer(int fileID, int offset); long toLong(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static FlumeEventPointer fromLong(long value);  }