Interface TradeCsvInfoResolver
-
public interface TradeCsvInfoResolver
Resolves additional information when parsing trade CSV files.Data loaded from a CSV may contain additional information that needs to be captured. This plugin point allows the additional CSV columns to be parsed and captured.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default TermDepositTrade
completeTrade(CsvRow row, TermDepositTrade trade)
Completes the trade, potentially parsing additional columns.default FraTrade
completeTrade(CsvRow row, FraTrade trade)
Completes the FRA trade, potentially parsing additional columns.default FxSingleTrade
completeTrade(CsvRow row, FxSingleTrade trade)
Completes the FX Forward trade, potentially parsing additional columns.default FxSwapTrade
completeTrade(CsvRow row, FxSwapTrade trade)
Completes the FX Swap trade, potentially parsing additional columns.default SecurityTrade
completeTrade(CsvRow row, SecurityTrade trade)
Completes the trade, potentially parsing additional columns.default SwapTrade
completeTrade(CsvRow row, SwapTrade trade)
Completes the FRA trade, potentially parsing additional columns.default <T extends Trade>
TcompleteTradeCommon(CsvRow row, T trade)
Completes the trade, potentially parsing additional columns.ReferenceData
getReferenceData()
Gets the reference data being used.static TradeCsvInfoResolver
of(ReferenceData refData)
Obtains an instance that uses the specified set of reference data.default void
parseTradeInfo(CsvRow row, TradeInfoBuilder builder)
Parses attributes intoTradeInfo
.static TradeCsvInfoResolver
standard()
Obtains an instance that uses the standard set of reference data.
-
-
-
Method Detail
-
standard
static TradeCsvInfoResolver standard()
Obtains an instance that uses the standard set of reference data.- Returns:
- the loader
-
of
static TradeCsvInfoResolver of(ReferenceData refData)
Obtains an instance that uses the specified set of reference data.- Parameters:
refData
- the reference data- Returns:
- the loader
-
getReferenceData
ReferenceData getReferenceData()
Gets the reference data being used.- Returns:
- the reference data
-
parseTradeInfo
default void parseTradeInfo(CsvRow row, TradeInfoBuilder builder)
Parses attributes intoTradeInfo
.If they are available, the trade ID, date, time and zone will have been set before this method is called. They may be altered if necessary, although this is not recommended.
- Parameters:
row
- the CSV row to parsebuilder
- the builder to update
-
completeTradeCommon
default <T extends Trade> T completeTradeCommon(CsvRow row, T trade)
Completes the trade, potentially parsing additional columns.This is called by each of the
completeTrade
methods.- Type Parameters:
T
- the trade type- Parameters:
row
- the CSV row to parsetrade
- the parsed trade- Returns:
- the updated trade
-
completeTrade
default FraTrade completeTrade(CsvRow row, FraTrade trade)
Completes the FRA trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder)
.By default this calls
completeTradeCommon(CsvRow, Trade)
.- Parameters:
row
- the CSV row to parsetrade
- the parsed trade- Returns:
- the updated trade
-
completeTrade
default SecurityTrade completeTrade(CsvRow row, SecurityTrade trade)
Completes the trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder)
.By default this calls
completeTradeCommon(CsvRow, Trade)
.- Parameters:
row
- the CSV row to parsetrade
- the parsed trade- Returns:
- the updated trade
-
completeTrade
default SwapTrade completeTrade(CsvRow row, SwapTrade trade)
Completes the FRA trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder)
.By default this calls
completeTradeCommon(CsvRow, Trade)
.- Parameters:
row
- the CSV row to parsetrade
- the parsed trade- Returns:
- the updated trade
-
completeTrade
default TermDepositTrade completeTrade(CsvRow row, TermDepositTrade trade)
Completes the trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder)
.By default this calls
completeTradeCommon(CsvRow, Trade)
.- Parameters:
row
- the CSV row to parsetrade
- the parsed trade- Returns:
- the updated trade
-
completeTrade
default FxSingleTrade completeTrade(CsvRow row, FxSingleTrade trade)
Completes the FX Forward trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder)
.By default this calls
completeTradeCommon(CsvRow, Trade)
.- Parameters:
row
- the CSV row to parsetrade
- the parsed trade, as an instance ofFxSingleTrade
- Returns:
- the updated trade, as an instance of
FxSingleTrade
-
completeTrade
default FxSwapTrade completeTrade(CsvRow row, FxSwapTrade trade)
Completes the FX Swap trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder)
.By default this calls
completeTradeCommon(CsvRow, Trade)
.- Parameters:
row
- the CSV row to parsetrade
- the parsed trade, as an instance ofFxSwapTrade
- Returns:
- the updated trade, as an instance of
FxSwapTrade
-
-