Interface CSVData


public interface CSVData
Provides methods for direct conversion to the csv format. It is best used in pure dataclasses since all fields of an implementing object will be extracted to the csv string.

Default implementation can be overwritten if needed. For consistency reasons this is not recommended.

Author:
Lion Wagner
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Converts this object to csv data.
    default String
    toCSVData(char sep)
    Converts this object to csv data.
    default String
    Gets the csv header for this object.
    default String
    toCSVHeader(char sep)
    Gets the csv header for this object.
  • Method Details

    • toCSVData

      default String toCSVData()
      Converts this object to csv data. Uses a comma for separation.
      Returns:
      a string, containing this objects data.
    • toCSVData

      default String toCSVData(char sep)
      Converts this object to csv data. Uses the provided separator.
      Parameters:
      sep - the char that should be used as separator
      Returns:
      a string, containing this objects data.
    • toCSVHeader

      default String toCSVHeader()
      Gets the csv header for this object. Values are separated by a comma.
      Returns:
      a comma-separated string, containing the names of all fields of this object
    • toCSVHeader

      default String toCSVHeader(char sep)
      Gets the csv header for this object. Values are separated by the provided separator.
      Returns:
      a character-separated string, containing the names of all fields of this object