- java.lang.Object
-
- de.siegmar.fastcsv.reader.RecordWrapper<T>
-
- Type Parameters:
T
- the record type
public final class RecordWrapper<T> extends java.lang.Object
A wrapper for a record that contains information necessary for theCsvReader
in order to determine how to process the record.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
comment
private boolean
emptyLine
private int
fieldCount
private T
wrappedRecord
-
Constructor Summary
Constructors Constructor Description RecordWrapper(boolean comment, boolean emptyLine, int fieldCount, T wrappedRecord)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getFieldCount()
Returns the number of fields in the record.T
getWrappedRecord()
Returns the actual record to be returned by theCsvReader
.boolean
isComment()
Returns whether the record denotes a comment.boolean
isEmptyLine()
Returns whether the record is empty.
-
-
-
Field Detail
-
comment
private final boolean comment
-
emptyLine
private final boolean emptyLine
-
fieldCount
private final int fieldCount
-
wrappedRecord
private final T wrappedRecord
-
-
Constructor Detail
-
RecordWrapper
RecordWrapper(boolean comment, boolean emptyLine, int fieldCount, T wrappedRecord)
Constructs a new instance.The
comment
andemptyLine
parameters are only used if theCsvReader
is configured to skip comments and/or empty lines. ThefieldCount
parameter is only used if theCsvReader
is configured to check the number of fields in each record. ThewrappedRecord
parameter is the actual record to be returned by theCsvReader
.- Parameters:
comment
- whether the record denotes a comment (to be skipped ifCsvReader.CsvReaderBuilder.commentStrategy(CommentStrategy)
is set toCommentStrategy.SKIP
emptyLine
- whether the record is empty (to be skipped ifCsvReader.CsvReaderBuilder.skipEmptyLines(boolean)
is set totrue
)fieldCount
- the number of fields in the record (to be checked against the number of fields in other records ifCsvReader.CsvReaderBuilder.ignoreDifferentFieldCount(boolean)
is set tofalse
)wrappedRecord
- the actual record to be returned by theCsvReader
, must not benull
-
-
Method Detail
-
isComment
public boolean isComment()
Returns whether the record denotes a comment.This method is only used if the
CsvReader
is configured to skip comments.- Returns:
true
if the record denotes a comment
-
isEmptyLine
public boolean isEmptyLine()
Returns whether the record is empty.This method is only used if the
CsvReader
is configured to skip empty lines.- Returns:
true
if the record is empty
-
getFieldCount
public int getFieldCount()
Returns the number of fields in the record.This method is only used if the
CsvReader
is configured to check the number of fields in each record.- Returns:
- the number of fields in the record
-
-