Enum Class CsvQuoting

java.lang.Object
java.lang.Enum<CsvQuoting>
io.github.dornol.excelkit.csv.CsvQuoting
All Implemented Interfaces:
Serializable, Comparable<CsvQuoting>, Constable

public enum CsvQuoting extends Enum<CsvQuoting>
Quoting strategies for CSV field values.

 CsvWriter.<Item>create()
     .quoting(CsvQuoting.ALL)
     .column("Name", Item::name)
     .write(stream);
 
Since:
0.9.2
  • Enum Constant Details

    • MINIMAL

      public static final CsvQuoting MINIMAL
      Quote only when necessary — when the value contains the delimiter, quotes, or newlines. This is the default behavior.
    • ALL

      public static final CsvQuoting ALL
      Quote all fields unconditionally.
    • NON_NUMERIC

      public static final CsvQuoting NON_NUMERIC
      Quote fields that are not purely numeric. Numeric values (integer and decimal) are left unquoted.
  • Method Details

    • values

      public static CsvQuoting[] 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

      public static CsvQuoting valueOf(String name)
      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 name
      NullPointerException - if the argument is null