예제 #1
0
  /**
   * Parses csv generated by {@link #toCsv()} to create
   *
   * @param csvParams String containing csv of params
   * @return ExportParams from the csv
   */
  public static ExportParams parseCsv(String csvParams) {
    String[] tokens = csvParams.split(";");
    ExportParams params = new ExportParams(ExportFormat.valueOf(tokens[0]));
    params.setExportTarget(ExportTarget.valueOf(tokens[1]));
    params.setExportStartTime(TimestampHelper.getTimestampFromUtcString(tokens[2]));
    params.setDeleteTransactionsAfterExport(Boolean.parseBoolean(tokens[3]));

    return params;
  }
예제 #2
0
 @Override
 public String toString() {
   return "Export all transactions created since "
       + TimestampHelper.getUtcStringFromTimestamp(mExportStartTime)
       + " UTC"
       + " as "
       + mExportFormat.name()
       + " to "
       + mExportTarget.name();
 }
예제 #3
0
  /**
   * Returns the export parameters formatted as CSV.
   *
   * <p>The CSV format is:
   * exportformat;exportTarget;shouldExportAllTransactions;shouldDeleteAllTransactions
   *
   * @return String containing CSV format of ExportParams
   */
  public String toCsv() {
    String separator = ";";

    return mExportFormat.name()
        + separator
        + mExportTarget.name()
        + separator
        + TimestampHelper.getUtcStringFromTimestamp(mExportStartTime)
        + separator
        + Boolean.toString(mDeleteTransactionsAfterExport);
  }