public class CsvRow extends ProxiedList<String>
List<String>
for convenience reasons.
Objects of this type include a back-reference to the parent Csv
object and the current row's index. If the parent object is marked
unmodifiable, its rows are unmodifiable, too.
For convenience the method get(String)
allows to retrieve values by
the column's CSV header value.
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
protected void |
finalize() |
Optional<String> |
get(String header)
Returns the current row's value of the column specified by
header . |
Csv |
getCsv()
Reference to the parent CSV object
|
int |
getRowIndex()
The current row's index
|
int |
hashCode() |
boolean |
isModifiable()
Flag specifying if this instance can be modified
|
String |
toString()
Returns a valid CSV string representation of this object using the default
separator and escaper.
|
String |
toString(char separator,
char escaper)
Returns a valid CSV string representation of this object using
separator and escaper . |
add, addAll, get, getWrappedForRead, getWrappedIfModifiable, indexOf, lastIndexOf, listIterator, listIterator, remove, set, subList
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected final void finalize() throws Throwable
public Optional<String> get(String header)
header
.
Valid headers are specified by the first row of the CSV. In case
header
is not a valid header or there is no value for the column of
the given header, Optional#empty()
is returned.
In case multiple headers with the name header
exist, the first column
is selected.
header
- the header name to search forheader
,
else emptypublic boolean isModifiable()
isModifiable
in class ProxiedCollection<String>
true
if this instance is modifiable, else false
public String toString()
toString
in class ProxiedCollection<String>
public String toString(char separator, char escaper)
separator
and escaper
.
This is a short-hand method for
StringConverters.encodeCsvRow(java.util.Collection, char, char)
.
separator
- the CSV separatorescaper
- the CSV value escaperseparator
and
escaper
public Csv getCsv()
public int getRowIndex()
public boolean equals(@Nullable Object o)
ProxiedCollection
equals
in interface Collection<String>
equals
in interface List<String>
equals
in class ProxiedCollection<String>
protected boolean canEqual(@Nullable Object other)
public int hashCode()
ProxiedCollection
hashCode
in interface Collection<String>
hashCode
in interface List<String>
hashCode
in class ProxiedCollection<String>
Copyright © 2025. All rights reserved.