/** * Parses from the CSV row. * * @param row the CSV row * @param info the trade info * @param resolver the resolver used to parse additional information * @return the parsed trade */ static TermDepositTrade parse(CsvRow row, TradeInfo info, TradeCsvInfoResolver resolver) { TermDepositTrade trade = parseRow(row, info, resolver); return resolver.completeTrade(row, trade); }
/** * Parses from the CSV row. * * @param row the CSV row * @param info the trade info * @param resolver the resolver used to parse additional information * @return the parsed trade */ static FraTrade parse(CsvRow row, TradeInfo info, TradeCsvInfoResolver resolver) { FraTrade trade = parseRow(row, info, resolver); return resolver.completeTrade(row, trade); }
/** * Parses the data from a CSV row. * * @param row the CSV row object * @param info the trade info object * @param resolver the resolver used to parse additional information. This is not currently used in this method. * @return the parsed trade, as an instance of {@link FxSingleTrade} */ static FxSwapTrade parse(CsvRow row, TradeInfo info, TradeCsvInfoResolver resolver) { FxSwapTrade trade = parseRow(row, info); return resolver.completeTrade(row, trade); }
/** * Parses the data from a CSV row. * * @param row the CSV row object * @param info the trade info object * @param resolver the resolver used to parse additional information. This is not currently used in this method. * @return the parsed trade, as an instance of {@link FxSingleTrade} */ static FxSingleTrade parse(CsvRow row, TradeInfo info, TradeCsvInfoResolver resolver) { FxSingleTrade trade = parseRow(row, info); return resolver.completeTrade(row, trade); }
/** * Parses from the CSV row. * * @param row the CSV row * @param info the trade info * @param resolver the resolver used to parse additional information * @return the parsed trade */ static SwapTrade parse(CsvRow row, List<CsvRow> variableRows, TradeInfo info, TradeCsvInfoResolver resolver) { SwapTrade trade = parseRow(row, info, resolver); trade = parseVariableNotional(trade, variableRows); trade = parseVariableRates(trade, variableRows); return resolver.completeTrade(row, trade); }
static SecurityQuantityTrade parseTrade(CsvRow row, TradeInfo info, TradeCsvInfoResolver resolver) { SecurityTrade trade = parseSecurityTrade(row, info, resolver); SecurityTrade base = resolver.completeTrade(row, trade); Optional<Double> tickSizeOpt = row.findValue(TICK_SIZE).map(str -> LoaderUtils.parseDouble(str)); Optional<Currency> currencyOpt = row.findValue(CURRENCY).map(str -> Currency.of(str)); Optional<Double> tickValueOpt = row.findValue(TICK_VALUE).map(str -> LoaderUtils.parseDouble(str)); double contractSize = row.findValue(CONTRACT_SIZE).map(str -> LoaderUtils.parseDouble(str)).orElse(1d); if (tickSizeOpt.isPresent() && currencyOpt.isPresent() && tickValueOpt.isPresent()) { SecurityPriceInfo priceInfo = SecurityPriceInfo.of(tickSizeOpt.get(), CurrencyAmount.of(currencyOpt.get(), tickValueOpt.get()), contractSize); GenericSecurity sec = GenericSecurity.of(SecurityInfo.of(base.getSecurityId(), priceInfo)); return GenericSecurityTrade.of(base.getInfo(), sec, base.getQuantity(), base.getPrice()); } return base; }