public TimestampPartitioningMap<T> copyInstallingNewValue( long lowerBoundForNewVersion, T newValue) { RangeAndValue<T> latestEntry = getLatestEntry(); validateProvidedTimestampBounds(lowerBoundForNewVersion, newValue, latestEntry); ImmutableRangeMap.Builder<Long, T> builder = ImmutableRangeMap.builder(); copyOldRangesFromPreviousMap(latestEntry, builder); addNewRanges(lowerBoundForNewVersion, newValue, latestEntry, builder); return ImmutableTimestampPartitioningMap.of(builder.build()); }
public TimestampPartitioningMap<T> copyInstallingNewValue( long lowerBoundForNewVersion, T newValue) { RangeAndValue<T> latestEntry = getLatestEntry(); validateProvidedTimestampBounds(lowerBoundForNewVersion, newValue, latestEntry); ImmutableRangeMap.Builder<Long, T> builder = ImmutableRangeMap.builder(); copyOldRangesFromPreviousMap(latestEntry, builder); addNewRanges(lowerBoundForNewVersion, newValue, latestEntry, builder); return ImmutableTimestampPartitioningMap.of(builder.build()); }