Class StringUtil.ToCSV<O>

java.lang.Object
org.nuiton.util.StringUtil.ToCSV<O>
Type Parameters:
O - type of object manipulated
All Implemented Interfaces:
StringUtil.ToString<O>
Enclosing class:
StringUtil

public static class StringUtil.ToCSV<O> extends Object implements StringUtil.ToString<O>
Used to build csv file using StringUtil.join(Iterable, ToString, String, boolean) method. This will provide a toString method to convert an object in a string and escape csv values if needed.
Author:
Benjamin Poussin - poussin@codelutin.com, Tony Chemit - chemit@codelutin.com
  • Field Details

    • csvSeparator

      protected String csvSeparator
  • Constructor Details

    • ToCSV

      public ToCSV(String csvSeparator)
  • Method Details

    • toString

      public String toString(O o)
      Description copied from interface: StringUtil.ToString
      Convert an object o in a string.
      Specified by:
      toString in interface StringUtil.ToString<O>
      Parameters:
      o - to convert
      Returns:
      the string for this object o
    • getStringValue

      public String getStringValue(O o)
      Use Object.toString() method by default Must be override to use other methods to get string value.
      Parameters:
      o - to convert
      Returns:
      String value