use of uk.gov.justice.services.event.buffer.core.repository.streambuffer.StreamBufferEvent in project microservice_framework by CJSCommonPlatform.
the class ConsecutiveEventsSpliterator method tryAdvance.
@Override
public boolean tryAdvance(final Consumer<? super StreamBufferEvent> consumer) {
if (!eventStreamIterator.hasNext()) {
return false;
} else {
final StreamBufferEvent next = eventStreamIterator.next();
final long version = next.getVersion();
if (versionGapFound(version)) {
return false;
} else {
currentVersion = version;
consumer.accept(next);
return true;
}
}
}
Aggregations