[CSV-239] Cannot get headers in column order from CSVRecord.

Rename CSVRecord.getCSVParser() -> getParser().
This commit is contained in:
Gary Gregory 2019-05-20 19:51:21 -04:00
parent d346048552
commit 6fd5179244
2 changed files with 6 additions and 6 deletions

View File

@ -79,10 +79,6 @@ public final class CSVRecord implements Serializable, Iterable<String> {
return values[i]; return values[i];
} }
private Map<String, Integer> getHeaderMapRaw() {
return parser.getHeaderMapRaw();
}
/** /**
* Returns a value by name. * Returns a value by name.
* *
@ -138,13 +134,17 @@ public final class CSVRecord implements Serializable, Iterable<String> {
return comment; return comment;
} }
private Map<String, Integer> getHeaderMapRaw() {
return parser.getHeaderMapRaw();
}
/** /**
* Returns the parser. * Returns the parser.
* *
* @return the parser. * @return the parser.
* @since 1.7 * @since 1.7
*/ */
public CSVParser getCSVParser() { public CSVParser getParser() {
return parser; return parser;
} }

View File

@ -108,7 +108,7 @@ public class CSVRecordTest {
public void testIsConsistent() { public void testIsConsistent() {
assertTrue(record.isConsistent()); assertTrue(record.isConsistent());
assertTrue(recordWithHeader.isConsistent()); assertTrue(recordWithHeader.isConsistent());
final Map<String, Integer> map = recordWithHeader.getCSVParser().getHeaderMap(); final Map<String, Integer> map = recordWithHeader.getParser().getHeaderMap();
map.put("fourth", Integer.valueOf(4)); map.put("fourth", Integer.valueOf(4));
// We are working on a copy of the map, so the record should still be OK. // We are working on a copy of the map, so the record should still be OK.
assertTrue(recordWithHeader.isConsistent()); assertTrue(recordWithHeader.isConsistent());