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()
void
close()
boolean
The path of the CSV file to write.org.apache.commons.csv.CSVPrinter
The 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).int
hashCode()
boolean
Indicator to append an existing file, or to overwrite and create a new CSV file.toString()
void
write
(@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:
close
in 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
-