Class TradeCsvWriter


  • public final class TradeCsvWriter
    extends java.lang.Object
    Writes trades to a CSV file.

    This takes a Strata Trade instance and creates a matching CSV file.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static TradeCsvWriter of​(TradeCsvInfoSupplier supplier)
      Obtains an instance that uses the specified supplier for additional information.
      static TradeCsvWriter standard()
      Obtains an instance that uses the standard set of reference data.
      void write​(java.util.List<? extends Trade> trades, java.lang.Appendable output)
      Write trades to an appendable in the applicable full details trade format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • standard

        public static TradeCsvWriter standard()
        Obtains an instance that uses the standard set of reference data.
        Returns:
        the loader
      • of

        public static TradeCsvWriter of​(TradeCsvInfoSupplier supplier)
        Obtains an instance that uses the specified supplier for additional information.
        Parameters:
        supplier - the supplier used to extract additional information to output
        Returns:
        the loader
      • write

        public void write​(java.util.List<? extends Trade> trades,
                          java.lang.Appendable output)
        Write trades to an appendable in the applicable full details trade format.

        The output is written in full details trade format.

        Parameters:
        trades - the trades to write
        output - the appendable to write to
        Throws:
        java.lang.IllegalArgumentException - if the metadata does not contain tenors
        java.io.UncheckedIOException - if an IO error occurs