mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-10 03:56:05 +00:00
[CSV-275] Make CSVRecord.toList() public.
This commit is contained in:
parent
00fcb06bb5
commit
f9f9feb80e
@ -39,6 +39,7 @@
|
||||
</properties>
|
||||
<body>
|
||||
<release version="1.9" date="2020-MM-DD" description="Feature and bug fix release (Java 8)">
|
||||
<!-- FIX -->
|
||||
<action type="add" dev="ggregory" due-to="dota17">Add test cases for CSVRecord with get(Enum) and toString. #54.</action>
|
||||
<action type="update" dev="ggregory" due-to="Amey Jadiye">Replace FindBugs with SpotBugs #56.</action>
|
||||
<action type="update" dev="ggregory" due-to="Chen">Javadoc typo in CSVFormat let's -> lets #57.</action>
|
||||
@ -57,6 +58,7 @@
|
||||
<action issue="CSV-267" type="fix" dev="ggregory" due-to="Arturo Bernal">Minor improvements #126, #127.</action>
|
||||
<action issue="CSV-123" type="fix" dev="ggregory" due-to="Emmanuel Bourg, Benedikt Ritter, shivakrishnaah, Gary Gregory">Add possibility to use ResultSet header meta data as CSV header #11.</action>
|
||||
<!-- ADD -->
|
||||
<action issue="CSV-275" type="add" dev="ggregory" due-to="Michael Wyraz, Gary Gregory">Make CSVRecord#toList() public.</action>
|
||||
<!-- UPDATE -->
|
||||
<action type="update" dev="ggregory" due-to="Gary Gregory">Update org.junit.jupiter:junit-jupiter from 5.6.0 to 5.7.0, #84 #109</action>
|
||||
<action type="update" dev="ggregory" due-to="Gary Gregory">Update tests from Apache Commons Lang 3.9 to 3.12.0.</action>
|
||||
|
@ -24,6 +24,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -291,11 +292,10 @@ public final class CSVRecord implements Serializable, Iterable<String> {
|
||||
/**
|
||||
* Converts the values to a List.
|
||||
*
|
||||
* TODO: Maybe make this public?
|
||||
*
|
||||
* @return a new List
|
||||
* @since 1.9.0
|
||||
*/
|
||||
private List<String> toList() {
|
||||
public List<String> toList() {
|
||||
return Arrays.asList(values);
|
||||
}
|
||||
|
||||
|
@ -248,6 +248,15 @@ public class CSVRecordTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToList() {
|
||||
int i = 0;
|
||||
for (final String value : record.toList()) {
|
||||
assertEquals(values[i], value);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToMap() {
|
||||
final Map<String, String> map = this.recordWithHeader.toMap();
|
||||
|
Loading…
x
Reference in New Issue
Block a user