Class CommaSeparatedValues
java.lang.Object
com.northconcepts.datapipeline.csv.CommaSeparatedValues
A collection of comma delimited values. The values are stored separately internally, but can be parsed or assembled as a simple CSV string.
-
Constructor Summary
ConstructorsConstructorDescriptionCommaSeparatedValues(String csvString) Parses the first line of the given comma-separated text; unquoted values are trimmed and become null when empty.CommaSeparatedValues(Collection<String> collection) Creates an instance backed by the given collection when it is anArrayList(changes are shared), otherwise by a copy of it. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(Collection<String> c) clear()booleanbooleanstatic CommaSeparatedValuesCreates an instance holding the given values or returns null if the array is null or empty.static CommaSeparatedValuesParses the given comma-separated text or returns null if it is null or blank.get(int index) inthashCode()intbooleanisEmpty()intremove(int index) booleanintsize()subList(int fromIndex, int toIndex) Returns a new instance holding a copy of the values fromfromIndex(inclusive) totoIndex(exclusive).Joins the values with a comma and a space, without quoting or escaping them.toString()
-
Constructor Details
-
CommaSeparatedValues
Parses the first line of the given comma-separated text; unquoted values are trimmed and become null when empty. -
CommaSeparatedValues
Creates an instance backed by the given collection when it is anArrayList(changes are shared), otherwise by a copy of it. -
CommaSeparatedValues
public CommaSeparatedValues()
-
-
Method Details
-
fromValue
Parses the given comma-separated text or returns null if it is null or blank. -
fromArray
Creates an instance holding the given values or returns null if the array is null or empty. -
getValues
-
toCsvString
Joins the values with a comma and a space, without quoting or escaping them. -
toString
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
add
-
remove
-
addAll
-
clear
-
equals
-
hashCode
public int hashCode() -
get
-
remove
-
indexOf
-
lastIndexOf
-
subList
Returns a new instance holding a copy of the values fromfromIndex(inclusive) totoIndex(exclusive).
-