java.lang.Object
de.siegmar.fastcsv.reader.RecordWrapper<T>
- Type Parameters:
T- the record type
A wrapper for a record that contains information necessary for the
CsvReader in order to determine how to
process the record.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanprivate final intprivate final T -
Constructor Summary
ConstructorsConstructorDescriptionRecordWrapper(boolean comment, boolean emptyLine, int fieldCount, T wrappedRecord) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of fields in the record.Returns the actual record to be returned by theCsvReader.booleanReturns whether the record denotes a comment.booleanReturns whether the record is empty.
-
Field Details
-
comment
private final boolean comment -
emptyLine
private final boolean emptyLine -
fieldCount
private final int fieldCount -
wrappedRecord
-
-
Constructor Details
-
RecordWrapper
RecordWrapper(boolean comment, boolean emptyLine, int fieldCount, T wrappedRecord) Constructs a new instance.The
commentandemptyLineparameters are only used if theCsvReaderis configured to skip comments and/or empty lines. ThefieldCountparameter is only used if theCsvReaderis configured to check the number of fields in each record. ThewrappedRecordparameter 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.SKIPemptyLine- 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 Details
-
isComment
public boolean isComment()Returns whether the record denotes a comment.This method is only used if the
CsvReaderis configured to skip comments.- Returns:
trueif the record denotes a comment
-
isEmptyLine
public boolean isEmptyLine()Returns whether the record is empty.This method is only used if the
CsvReaderis configured to skip empty lines.- Returns:
trueif the record is empty
-
getFieldCount
public int getFieldCount()Returns the number of fields in the record.This method is only used if the
CsvReaderis configured to check the number of fields in each record.- Returns:
- the number of fields in the record
-
getWrappedRecord
Returns the actual record to be returned by theCsvReader.- Returns:
- the actual record to be returned by the
CsvReader, nevernull
-