@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof DocumentState)) return false; DocumentState that = (DocumentState) o; if (removeEntry != that.removeEntry) return false; if (timestamp != that.timestamp) return false; if (docId != null ? !docId.equals(that.docId) : that.docId != null) return false; return gid.equals(that.gid); }
@Override public boolean equals(Object o) { if (o instanceof DocsumPacketKey) { DocsumPacketKey other = (DocsumPacketKey) o; if (globalId.equals(other.getGlobalId()) && partid == other.getPartid() && strEquals(summaryClass, other.summaryClass)) { return true; } } return false; }
public void addDocsums(DocsumPacketKey[] packetKeys, Packet[] packets) { if (packetKeys == null || packets == null) { log.warning( "addDocsums called with " + (packetKeys == null ? "packetKeys == null " : "") + (packets == null ? "packets == null" : "")); return; } for (int i = 0; i < packetKeys.length && i < packets.length; i++) { if (packetKeys[i] == null) { log.warning( "addDocsums called, but packetsKeys[" + i + "] is null"); } else if (packets[i] instanceof DocsumPacket) { DocsumPacket dp = (DocsumPacket) packets[i]; if (packetKeys[i].getGlobalId().equals(dp.getGlobalId()) && dp.getData().length > 0) { this.packets.put(packetKeys[i], packets[i]); log.fine("addDocsums " + i + " globalId: " + dp.getGlobalId()); } else { log.warning("not caching bad Docsum for globalId " + packetKeys[i].getGlobalId() + ": " + dp); } } else { log.warning( "addDocsums called, but packets[" + i + "] is not a DocsumPacket instance"); } } }