@@ -32,6 +32,7 @@ class CsvFileReader internal constructor(
32
32
* @return return fields in row as List<String>.
33
33
* or return null, if all line are already read.
34
34
*/
35
+ @Deprecated(" We are considering making it a private method. If you have feedback, please comment on Issue #100." )
35
36
fun readNext (): List <String >? {
36
37
return readUntilNextCsvRow(" " )
37
38
}
@@ -42,12 +43,13 @@ class CsvFileReader internal constructor(
42
43
fun readAllAsSequence (fieldsNum : Int? = null): Sequence <List <String >> {
43
44
var expectedNumFieldsInRow: Int? = fieldsNum
44
45
return generateSequence {
45
- readNext()
46
+ @Suppress( " DEPRECATION " ) readNext()
46
47
}.mapIndexedNotNull { idx, row ->
47
48
// If no expected number of fields was passed in, then set it based on the first row.
48
49
if (expectedNumFieldsInRow == null ) expectedNumFieldsInRow = row.size
49
50
// Assign this number to a non-nullable type to avoid need for thread-safety null checks.
50
51
val numFieldsInRow: Int = expectedNumFieldsInRow ? : row.size
52
+ @Suppress(" DEPRECATION" )
51
53
if (row.size > numFieldsInRow) {
52
54
if (ctx.excessFieldsRowBehaviour == ExcessFieldsRowBehaviour .TRIM ) {
53
55
logger.info { " trimming excess rows. [csv row num = ${idx + 1 } , fields num = ${row.size} , fields num of row = $numFieldsInRow ]" }
@@ -82,6 +84,7 @@ class CsvFileReader internal constructor(
82
84
* read all csv rows as Sequence with header information
83
85
*/
84
86
fun readAllWithHeaderAsSequence (): Sequence <Map <String , String >> {
87
+ @Suppress(" DEPRECATION" )
85
88
var headers = readNext() ? : return emptySequence()
86
89
if (ctx.autoRenameDuplicateHeaders) {
87
90
headers = deduplicateHeaders(headers)
0 commit comments