java.lang.Object
de.siegmar.fastcsv.reader.FieldModifiers
Provides some common
FieldModifier implementations.
Example usage:
var modifier = FieldModifiers.TRIM.andThen(FieldModifiers.upper(Locale.ENGLISH));
var fields = CsvReader.builder()
.build(new CsvRecordHandler(modifier, " foo , bar"))
.stream()
.collect(Collectors.toList());
// fields would be: "FOO" and "BAR"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FieldModifierModifier that does not modify anything.static final FieldModifierModifier that modifies the field value withString.strip().static final FieldModifierModifier that modifies the field value withString.trim(). -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldModifierBuilds modifier that modifies the field value withString.toLowerCase(Locale).static FieldModifierBuilds modifier that modifies the field value withString.toUpperCase(Locale).
-
Field Details
-
NOP
Modifier that does not modify anything. -
TRIM
Modifier that modifies the field value withString.trim(). Comments are not modified. -
STRIP
Modifier that modifies the field value withString.strip(). Comments are not modified.
-
-
Method Details
-
lower
Builds modifier that modifies the field value withString.toLowerCase(Locale). Comments are not modified.- Parameters:
locale- use the case transformation rules for this locale- Returns:
- a new field modifier that converts the input to lower-case.
-
upper
Builds modifier that modifies the field value withString.toUpperCase(Locale). Comments are not modified.- Parameters:
locale- use the case transformation rules for this locale- Returns:
- a new field modifier that converts the input to upper-case.
-