@Test public void testPacboyShardInfoEqualsForParentIds() { Set<String> diffParentIds = new HashSet<>(); diffParentIds.add("shard-3"); diffParentIds.add("shard-4"); ShardInfo diffShardInfo = new ShardInfo(SHARD_ID, CONCURRENCY_TOKEN, diffParentIds, ExtendedSequenceNumber.LATEST); assertFalse("Equal should return false with different parent shard Ids", diffShardInfo.equals(testShardInfo)); diffShardInfo = new ShardInfo(SHARD_ID, CONCURRENCY_TOKEN, null, ExtendedSequenceNumber.LATEST); assertFalse("Equal should return false with null parent shard Ids", diffShardInfo.equals(testShardInfo)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ShardInfo other = (ShardInfo) obj; return new EqualsBuilder().append(concurrencyToken, other.concurrencyToken) .append(parentShardIds, other.parentShardIds).append(shardId, other.shardId) .append(streamIdentifierSerOpt.orElse(""), other.streamIdentifierSerOpt.orElse("")).isEquals(); }
ShardInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ShardInfo other = (ShardInfo) obj; return new EqualsBuilder().append(concurrencyToken, other.concurrencyToken) .append(parentShardIds, other.parentShardIds).append(shardId, other.shardId) .append(streamIdentifierSerOpt.orElse(""), other.streamIdentifierSerOpt.orElse("")).isEquals(); } }
ShardInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ShardInfo other = (ShardInfo) obj; return new EqualsBuilder().append(concurrencyToken, other.concurrencyToken) .append(parentShardIds, other.parentShardIds).append(shardId, other.shardId) .append(streamIdentifierSerOpt.orElse(""), other.streamIdentifierSerOpt.orElse("")).isEquals(); } ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint);  ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint,
            final String streamIdentifierSer); }
ShardInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ShardInfo other = (ShardInfo) obj; return new EqualsBuilder().append(concurrencyToken, other.concurrencyToken) .append(parentShardIds, other.parentShardIds).append(shardId, other.shardId) .append(streamIdentifierSerOpt.orElse(""), other.streamIdentifierSerOpt.orElse("")).isEquals(); } ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint);  ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint,
            final String streamIdentifierSer); List<String> parentShardIds(); boolean isCompleted(); @Override int hashCode(); @Override boolean equals(Object obj); static String getLeaseKey(ShardInfo shardInfo); static String getLeaseKey(ShardInfo shardInfo, String shardIdOverride); }
ShardInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ShardInfo other = (ShardInfo) obj; return new EqualsBuilder().append(concurrencyToken, other.concurrencyToken) .append(parentShardIds, other.parentShardIds).append(shardId, other.shardId) .append(streamIdentifierSerOpt.orElse(""), other.streamIdentifierSerOpt.orElse("")).isEquals(); } ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint);  ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint,
            final String streamIdentifierSer); List<String> parentShardIds(); boolean isCompleted(); @Override int hashCode(); @Override boolean equals(Object obj); static String getLeaseKey(ShardInfo shardInfo); static String getLeaseKey(ShardInfo shardInfo, String shardIdOverride);  }