Class AbstractWriter<T>

java.lang.Object
com.bluebell.greenhouse.sol.writers.AbstractWriter<T>
Type Parameters:
T - entity type to write
Direct Known Subclasses:
CsvMarketPriceWriter, CsvPositionWriter, CsvTransactionWriter

public abstract class AbstractWriter<T> extends Object
Parent-level writer containing re-usable logic.
Version:
1.0.9
Author:
Stephen Prizio
  • Constructor Details

    • AbstractWriter

      public AbstractWriter()
  • Method Details

    • writeDelimitedString

      protected String writeDelimitedString(List<T> entities, String delimiter, Map<String, Function<T,?>> headers)
      Writes the given List of Ts into a delimited string.
      Parameters:
      entities - List of Ts to be written
      delimiter - delimiter
      headers - mapping of header names to functions for extracting values from T
      Returns:
      delimited string representation of the entities
    • writeDelimitedString

      protected void writeDelimitedString(List<T> entities, String delimiter, Map<String, Function<T,?>> headers, Appendable writer) throws IOException
      Writes the given List of Ts into a delimited writer.
      Parameters:
      entities - List of Ts to be written
      delimiter - delimiter
      headers - mapping of header names to functions for extracting values from T
      writer - destination writer
      Throws:
      IOException - io exception while writing