Package com.opengamma.strata.loader.csv
Class GenericSecurityTradeCsvPlugin
- java.lang.Object
-
- com.opengamma.strata.loader.csv.GenericSecurityTradeCsvPlugin
-
- All Implemented Interfaces:
Named,TradeCsvWriterPlugin<GenericSecurityTrade>
public class GenericSecurityTradeCsvPlugin extends Object implements TradeCsvWriterPlugin<GenericSecurityTrade>
Handles the CSV file format for Generic Security trades.
-
-
Field Summary
Fields Modifier and Type Field Description static GenericSecurityTradeCsvPluginINSTANCEThe singleton instance of the plugin.
-
Constructor Summary
Constructors Constructor Description GenericSecurityTradeCsvPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Gets the name that uniquely identifies this parser.Set<String>headers(List<GenericSecurityTrade> trades)Returns the set of headers needed for this type of trade.Set<Class<?>>supportedTradeTypes()Provides the supported trade types for this plugin.voidwriteCsv(CsvOutput.CsvRowOutputWithHeaders csv, GenericSecurityTrade trade)Writes the CSV for the specified trade.
-
-
-
Field Detail
-
INSTANCE
public static final GenericSecurityTradeCsvPlugin INSTANCE
The singleton instance of the plugin.
-
-
Method Detail
-
headers
public Set<String> headers(List<GenericSecurityTrade> trades)
Description copied from interface:TradeCsvWriterPluginReturns the set of headers needed for this type of trade.The headers are ordered and all distinct.
- Specified by:
headersin interfaceTradeCsvWriterPlugin<GenericSecurityTrade>- Parameters:
trades- the trades to output- Returns:
- the set of additional headers
-
writeCsv
public void writeCsv(CsvOutput.CsvRowOutputWithHeaders csv, GenericSecurityTrade trade)
Description copied from interface:TradeCsvWriterPluginWrites the CSV for the specified trade.- Specified by:
writeCsvin interfaceTradeCsvWriterPlugin<GenericSecurityTrade>- Parameters:
csv- the CSV to write totrade- the trade to output
-
getName
public String getName()
Description copied from interface:TradeCsvWriterPluginGets the name that uniquely identifies this parser.The name should typically be the name of the
Productthat can be parsed. For example, 'Fra', 'Swap' or 'FxSingle'.This name is used in serialization and an be parsed using
TradeCsvWriterPlugin.of(String).- Specified by:
getNamein interfaceNamed- Specified by:
getNamein interfaceTradeCsvWriterPlugin<GenericSecurityTrade>- Returns:
- the unique name
-
supportedTradeTypes
public Set<Class<?>> supportedTradeTypes()
Description copied from interface:TradeCsvWriterPluginProvides the supported trade types for this plugin.The set typically contains the names of the
Tradethat can be written. For example, 'FraTrade', 'SwapTrade'.- Specified by:
supportedTradeTypesin interfaceTradeCsvWriterPlugin<GenericSecurityTrade>- Returns:
- the set of supported trade types.
-
-