java.lang.Object
be.yildizgames.common.csv.CsvLine
public class CsvLine extends Object
Represent a line in a CSV document.
Immutable class.
- Author:
- Grégory Van den Borre
-
Method Summary
Modifier and Type Method Description void
addToFile(Path file)
Append this line to a file.List<String>
getEntries()
Provide the csv line head.String
getHead()
Provide the csv line head.String
getRaw()
Provide the csv raw line.static CsvLine
toLine(String separator, Object... values)
Create a new line from entries and a separator.static CsvLine
toLine(String raw, String separator)
-
Method Details
-
toLine
Create a new line from entries and a separator.- Parameters:
separator
- Separator to set between the entries (cannot be null).values
- List of entries to set (Cannot be null).- Returns:
- The created line (never null).
- Throws:
NullPointerException
- If any parameter is null.
-
toLine
-
addToFile
Append this line to a file.- Parameters:
file
- File to use (cannot be null).- Throws:
NullPointerException
- If any parameter is null.
-
getHead
Provide the csv line head.- Returns:
- The head (never null).
-
getRaw
Provide the csv raw line.- Returns:
- The raw line (never null).
-
getEntries
Provide the csv line head.- Returns:
- The head (never null, immutable collection).
-