/** * Adds market data values for each scenario. * <p> * Each value in the map is a market data box. * Any existing value with the same identifier will be replaced. * * @param values the items of market data, keyed by identifier * @return this builder */ public ImmutableScenarioMarketDataBuilder addBoxMap( Map<? extends MarketDataId<?>, ? extends MarketDataBox<?>> values) { ArgChecker.notNull(values, "values"); for (Entry<? extends MarketDataId<?>, ? extends MarketDataBox<?>> entry : values.entrySet()) { MarketDataId<?> id = entry.getKey(); MarketDataBox<?> box = entry.getValue(); checkBoxType(id, box); checkAndUpdateScenarioCount(box); this.values.put(id, box); } return this; }
/** * Adds market data values for each scenario. * <p> * Each value in the map contains multiple market data items, one for each scenario. * Any existing value with the same identifier will be replaced. * * @param values the items of market data, keyed by identifier * @return this builder */ public ImmutableScenarioMarketDataBuilder addScenarioValueMap( Map<? extends MarketDataId<?>, ? extends ScenarioArray<?>> values) { ArgChecker.notNull(values, "values"); for (Entry<? extends MarketDataId<?>, ? extends ScenarioArray<?>> entry : values.entrySet()) { MarketDataId<?> id = entry.getKey(); ScenarioArray<?> value = entry.getValue(); MarketDataBox<?> box = MarketDataBox.ofScenarioValue(value); checkBoxType(id, box); checkAndUpdateScenarioCount(box); this.values.put(id, box); } return this; }
/** * Adds market data values that are valid for all scenarios. * <p> * Each value in the map is a single item of market data used in all scenarios. * Any existing value with the same identifier will be replaced. * * @param values the items of market data, keyed by identifier * @return this builder */ public ImmutableScenarioMarketDataBuilder addValueMap(Map<? extends MarketDataId<?>, ?> values) { ArgChecker.notNull(values, "values"); for (Entry<? extends MarketDataId<?>, ?> entry : values.entrySet()) { MarketDataId<?> id = entry.getKey(); Object value = entry.getValue(); MarketDataBox<?> box = MarketDataBox.ofSingleValue(value); checkBoxType(id, box); checkAndUpdateScenarioCount(box); this.values.put(id, box); } return this; }