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 GenericSecurityTradeCsvPlugin
INSTANCE
The singleton instance of the plugin.
-
Constructor Summary
Constructors Constructor Description GenericSecurityTradeCsvPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
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.void
writeCsv(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:TradeCsvWriterPlugin
Returns the set of headers needed for this type of trade.The headers are ordered and all distinct.
- Specified by:
headers
in 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:TradeCsvWriterPlugin
Writes the CSV for the specified trade.- Specified by:
writeCsv
in interfaceTradeCsvWriterPlugin<GenericSecurityTrade>
- Parameters:
csv
- the CSV to write totrade
- the trade to output
-
getName
public String getName()
Description copied from interface:TradeCsvWriterPlugin
Gets the name that uniquely identifies this parser.The name should typically be the name of the
Product
that 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:
getName
in interfaceNamed
- Specified by:
getName
in interfaceTradeCsvWriterPlugin<GenericSecurityTrade>
- Returns:
- the unique name
-
supportedTradeTypes
public Set<Class<?>> supportedTradeTypes()
Description copied from interface:TradeCsvWriterPlugin
Provides the supported trade types for this plugin.The set typically contains the names of the
Trade
that can be written. For example, 'FraTrade', 'SwapTrade'.- Specified by:
supportedTradeTypes
in interfaceTradeCsvWriterPlugin<GenericSecurityTrade>
- Returns:
- the set of supported trade types.
-
-