mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add data model entities for .app discounting
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=121580499
This commit is contained in:
parent
b435e20cbe
commit
3ec6aebe44
8 changed files with 43 additions and 904 deletions
|
@ -139,8 +139,23 @@ public class TimedTransitionProperty<V, T extends TimedTransitionProperty.TimedT
|
|||
public static <V, T extends TimedTransition<V>> TimedTransitionProperty<V, T> forMapify(
|
||||
ImmutableSortedMap<DateTime, V> valueMap,
|
||||
Class<T> timedTransitionSubclass) {
|
||||
return new TimedTransitionProperty<>(new TreeMap<>(
|
||||
makeTransitionMap(valueMap, timedTransitionSubclass)));
|
||||
return new TimedTransitionProperty<>(
|
||||
new TreeMap<>(makeTransitionMap(valueMap, timedTransitionSubclass)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new mutable {@code TimedTransitionProperty} representing the given value being set at
|
||||
* start of time, constructed using the given {@code TimedTransition} subclass.
|
||||
*
|
||||
* <p>
|
||||
* This method should only be used for initializing fields that are declared with the @Mapify
|
||||
* annotation. The map for those fields must be mutable so that Objectify can load values from the
|
||||
* datastore into the map, but clients should still never mutate the field's map directly.
|
||||
*/
|
||||
public static <V, T extends TimedTransition<V>> TimedTransitionProperty<V, T> forMapify(
|
||||
V valueAtStartOfTime, Class<T> timedTransitionSubclass) {
|
||||
return forMapify(
|
||||
ImmutableSortedMap.of(START_OF_TIME, valueAtStartOfTime), timedTransitionSubclass);
|
||||
}
|
||||
|
||||
/** The backing map of DateTime to TimedTransition subclass used to store the transitions. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue