public class HistoryRecordComparator extends Object
| Modifier and Type | Field and Description |
|---|---|
static HistoryRecordComparator |
INSTANCE
A comparator instance that requires the
records' sources to be the same and considers only
those fields that are in both records' positions. |
| Constructor and Description |
|---|
HistoryRecordComparator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAtOrBefore(HistoryRecord record1,
HistoryRecord record2)
Determine if the first
HistoryRecord is at the same or earlier point in time than the second HistoryRecord. |
protected boolean |
isPositionAtOrBefore(Document position1,
Document position2) |
protected boolean |
isSameSource(Document source1,
Document source2) |
static HistoryRecordComparator |
usingPositions(BiFunction<Document,Document,Boolean> positionComparator)
Create a
HistoryRecordComparator that requires identical sources but will use the supplied function to compare
positions. |
public static final HistoryRecordComparator INSTANCE
records' sources to be the same and considers only
those fields that are in both records' positions.public static HistoryRecordComparator usingPositions(BiFunction<Document,Document,Boolean> positionComparator)
HistoryRecordComparator that requires identical sources but will use the supplied function to compare
positions.positionComparator - the non-null function that returns true if the first position is at or before
the second position or false otherwisepublic boolean isAtOrBefore(HistoryRecord record1, HistoryRecord record2)
HistoryRecord is at the same or earlier point in time than the second HistoryRecord.record1 - the first record; never nullrecord2 - the second record; never nulltrue if the first record is at the same or earlier point in time than the second record, or false
otherwiseCopyright © 2019 JBoss by Red Hat. All rights reserved.