feat: reduce duplication in BasicIndexingConverter
This commit is contained in:
parent
eaeb4bc1d8
commit
97fd2dc821
|
@ -560,10 +560,11 @@ public class BasicIndexingConverter {
|
||||||
long inReplyToUserIdVal,
|
long inReplyToUserIdVal,
|
||||||
boolean strict,
|
boolean strict,
|
||||||
EarlybirdThriftDocumentBuilder builder) {
|
EarlybirdThriftDocumentBuilder builder) {
|
||||||
Optional<Long> retweetUserId = Optional.of(retweetUserIdVal).filter(id -> id > 0);
|
Predicate<Long> isGreaterThanZero = id -> id > 0;
|
||||||
Optional<Long> sharedStatusId = Optional.of(sharedStatusIdVal).filter(id -> id > 0);
|
Optional<Long> retweetUserId = Optional.of(retweetUserIdVal).filter(isGreaterThanZero);
|
||||||
Optional<Long> inReplyToUserId = Optional.of(inReplyToUserIdVal).filter(id -> id > 0);
|
Optional<Long> sharedStatusId = Optional.of(sharedStatusIdVal).filter(isGreaterThanZero);
|
||||||
Optional<Long> inReplyToStatusId = Optional.of(inReplyToStatusIdVal).filter(id -> id > 0);
|
Optional<Long> inReplyToUserId = Optional.of(inReplyToUserIdVal).filter(isGreaterThanZero);
|
||||||
|
Optional<Long> inReplyToStatusId = Optional.of(inReplyToStatusIdVal).filter(isGreaterThanZero);
|
||||||
|
|
||||||
Preconditions.checkState(retweetUserId.isPresent() == sharedStatusId.isPresent());
|
Preconditions.checkState(retweetUserId.isPresent() == sharedStatusId.isPresent());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue