mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add utility methods for copying time transition maps and filtering grace periods
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130281141
This commit is contained in:
parent
19da9a1531
commit
57ec8b3ae3
2 changed files with 42 additions and 0 deletions
|
@ -125,6 +125,17 @@ public class TimedTransitionProperty<V, T extends TimedTransitionProperty.TimedT
|
|||
makeTransitionMap(valueMap, timedTransitionSubclass)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new immutable {@code TimedTransitionProperty} containing the same transitions as the
|
||||
* current object, up to but not including the desired date. All transitions on or after that date
|
||||
* will be deleted.
|
||||
*
|
||||
* @param asOfDate the date before which transitions should be retained
|
||||
*/
|
||||
public TimedTransitionProperty<V, T> copyUntilJustBefore(DateTime asOfDate) {
|
||||
return new TimedTransitionProperty<>(backingMap.headMap(asOfDate, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new mutable {@code TimedTransitionProperty} representing the given map of DateTime
|
||||
* to value, with transitions constructed using the given {@code TimedTransition} subclass.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue