public static boolean isTerminalRow(boolean reverse, @Nonnull byte[] rowName) { if (reverse) { return isFirstRowName(rowName); } else { return isLastRowName(rowName); } }
public static boolean isFirstRowName(boolean reverse, @Nonnull byte[] name) { return reverse ? isLastRowName(name) : isFirstRowName(name); }
@JsonIgnore public boolean isEmptyRange() { if (startInclusive.length == 0 && RangeRequests.isFirstRowName(reverse, endExclusive)) { return true; } if (startInclusive.length == 0 || endExclusive.length == 0) { return false; } if (reverse) { return UnsignedBytes.lexicographicalComparator().compare(startInclusive, endExclusive) <= 0; } else { return UnsignedBytes.lexicographicalComparator().compare(startInclusive, endExclusive) >= 0; } }
@Nullable public static byte[] getNextStartRowUnlessTerminal(boolean reverse, @Nonnull byte[] rowName) { if (reverse) { if (isFirstRowName(rowName)) { return null; } else { return previousLexicographicName(rowName); } } else { return nextLexicographicNameInternal(rowName); } } }
public static boolean isTerminalRow(boolean reverse, @Nonnull byte[] rowName) { if (reverse) { return isFirstRowName(rowName); } else { return isLastRowName(rowName); } }
public static boolean isFirstRowName(boolean reverse, @Nonnull byte[] name) { return reverse ? isLastRowName(name) : isFirstRowName(name); }
@Nullable public static byte[] getNextStartRowUnlessTerminal(boolean reverse, @Nonnull byte[] rowName) { if (reverse) { if (isFirstRowName(rowName)) { return null; } else { return previousLexicographicName(rowName); } } else { return nextLexicographicNameInternal(rowName); } } }
@JsonIgnore public boolean isEmptyRange() { if (startInclusive.length == 0 && RangeRequests.isFirstRowName(reverse, endExclusive)) { return true; } if (startInclusive.length == 0 || endExclusive.length == 0) { return false; } if (reverse) { return UnsignedBytes.lexicographicalComparator().compare(startInclusive, endExclusive) <= 0; } else { return UnsignedBytes.lexicographicalComparator().compare(startInclusive, endExclusive) >= 0; } }