Enum Class FieldModifiers
- All Implemented Interfaces:
FieldModifier, Serializable, Comparable<FieldModifiers>, Constable
Provides some common FieldModifier implementations.
Example usage:
FieldModifier modifier = FieldModifiers.TRIM
.andThen(FieldModifier.modify(field -> field.toUpperCase(Locale.ENGLISH)));
CsvRecordHandler handler = CsvRecordHandler.of(c -> c.fieldModifier(modifier));
List<CsvRecord> records = CsvReader.builder()
.build(handler, " foo , bar")
.stream()
.toList();
// fields would be: "FOO" and "BAR"
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionModifier that does not modify anything.Modifier that modifies the field value withString.strip().Modifier that modifies the field value withString.trim(). -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldModifiersReturns the enum constant of this class with the specified name.static FieldModifiers[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface FieldModifier
andThen, modify, modifyComment
-
Enum Constant 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
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-