public final class NamedCsvReader extends java.lang.Object implements java.lang.Iterable<NamedCsvRow>, java.io.Closeable
Example use:
try (NamedCsvReader csvReader = NamedCsvReader.builder().build(path)) {
for (NamedCsvRow row : csvReader) {
...
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
NamedCsvReader.NamedCsvReaderBuilder
This builder is used to create configured instances of
NamedCsvReader. |
| Modifier and Type | Method and Description |
|---|---|
static NamedCsvReader.NamedCsvReaderBuilder |
builder()
Constructs a
NamedCsvReader.NamedCsvReaderBuilder to configure and build instances of this class. |
void |
close() |
java.util.Set<java.lang.String> |
getHeader()
Returns the header columns.
|
CloseableIterator<NamedCsvRow> |
iterator() |
java.util.Spliterator<NamedCsvRow> |
spliterator() |
java.util.stream.Stream<NamedCsvRow> |
stream()
Creates a new sequential
Stream from this instance. |
java.lang.String |
toString() |
public static NamedCsvReader.NamedCsvReaderBuilder builder()
NamedCsvReader.NamedCsvReaderBuilder to configure and build instances of this class.NamedCsvReader.NamedCsvReaderBuilder instance.public java.util.Set<java.lang.String> getHeader()
public CloseableIterator<NamedCsvRow> iterator()
iterator in interface java.lang.Iterable<NamedCsvRow>public java.util.Spliterator<NamedCsvRow> spliterator()
spliterator in interface java.lang.Iterable<NamedCsvRow>public java.util.stream.Stream<NamedCsvRow> stream()
Stream from this instance.
A close handler is registered by this method in order to close the underlying resources. Don't forget to close the returned stream when you're done.
Stream.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object