Class InventoryCsvWriter
java.lang.Object
com.amilesend.discogs.csv.InventoryCsvWriter
- All Implemented Interfaces:
AutoCloseable
Utility to write an inventory CSV file used for Discogs inventory management (i.e., creating new inventory items,
or update existing inventory items).
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidclose()booleanThe path of the CSV file to write.org.apache.commons.csv.CSVPrinterThe printer used to format and write to the file.The list of defined CSV headers to be included in the CSV file.The record type (i.e., for new inventory items, or to update existing items).inthashCode()booleanIndicator to append an existing file, or to overwrite and create a new CSV file.toString()voidwrite(@NonNull InventoryRecord record) Writes a record to the CSV file.
-
Method Details
-
write
Writes a record to the CSV file.- Parameters:
record- the record to write- Throws:
ValidationException- if there is an error with the recordIOException- if there is an issue writing the record to the file
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
toString
-
builder
-
getCsvFile
The path of the CSV file to write. -
isAppended
public boolean isAppended()Indicator to append an existing file, or to overwrite and create a new CSV file. -
getHeaders
The list of defined CSV headers to be included in the CSV file.- See Also:
-
getCsvPrinter
public org.apache.commons.csv.CSVPrinter getCsvPrinter()The printer used to format and write to the file. -
getRecordType
The record type (i.e., for new inventory items, or to update existing items).- See Also:
-
equals
-
hashCode
-