Package com.opengamma.strata.loader.csv
Interface TradeCsvWriterPlugin<T extends Trade>
-
- Type Parameters:
T
- the trade type
- All Superinterfaces:
Named
- All Known Implementing Classes:
FxNdfTradeCsvPlugin
,FxSingleBarrierOptionTradeCsvPlugin
,GenericSecurityTradeCsvPlugin
,IborCapFloorTradeCsvPlugin
,SecurityTradeCsvPlugin
public interface TradeCsvWriterPlugin<T extends Trade> extends Named
Pluggable CSV trade writer.Implementations of this interface write trades to a CSV file.
See
TradeCsvWriter
for the main entry point to writing.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ExtendedEnum<TradeCsvWriterPlugin<?>>
extendedEnum()
Gets the extended enum helper.String
getName()
Gets the name that uniquely identifies this parser.Set<String>
headers(List<T> trades)
Returns the set of headers needed for this type of trade.static TradeCsvWriterPlugin<?>
of(String uniqueName)
Obtains an instance from the specified unique name.Set<Class<?>>
supportedTradeTypes()
Provides the supported trade types for this plugin.void
writeCsv(CsvOutput.CsvRowOutputWithHeaders csv, T trade)
Writes the CSV for the specified trade.
-
-
-
Method Detail
-
of
static TradeCsvWriterPlugin<?> of(String uniqueName)
Obtains an instance from the specified unique name.- Parameters:
uniqueName
- the unique name- Returns:
- the writer
- Throws:
IllegalArgumentException
- if the name is not known
-
extendedEnum
static ExtendedEnum<TradeCsvWriterPlugin<?>> extendedEnum()
Gets the extended enum helper.This helper allows instances of the parser to be looked up. It also provides the complete set of available instances.
- Returns:
- the extended enum helper
-
headers
Set<String> headers(List<T> trades)
Returns the set of headers needed for this type of trade.The headers are ordered and all distinct.
- Parameters:
trades
- the trades to output- Returns:
- the set of additional headers
-
writeCsv
void writeCsv(CsvOutput.CsvRowOutputWithHeaders csv, T trade)
Writes the CSV for the specified trade.- Parameters:
csv
- the CSV to write totrade
- the trade to output
-
getName
String getName()
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
of(String)
.
-
-