Class StringWritableCsv


  • public class StringWritableCsv
    extends Object
    Helper class to generate Comma Separated Values of StringWritables
    • Constructor Detail

      • StringWritableCsv

        public StringWritableCsv()
    • Method Detail

      • parseFrom

        public static String[] parseFrom​(String value,
                                         int n,
                                         int offset)
                                  throws IllegalArgumentException
        Parse a String with a StringWritableCsv into its composing Strings represented as Strings. No validation is performed on the individual attribute-values returned.
        Parameters:
        value - The String with the set of attribute-values
        n - Number of entries to return (entries will be null of there were not enough). 0 means unlimited
        offset - How many entries to skip before start returning
        Returns:
        An array of Strings which represent the individual attribute-values
        Throws:
        IllegalArgumentException - If value is null or either n or offset are negative
      • parseFrom

        public static String[] parseFrom​(String value,
                                         int n)
                                  throws IllegalArgumentException
        Parse a String with a StringWritableCsv into its composing Strings represented as Strings. No validation is performed on the individual attribute-values returned. Elements are returned starting from the first available attribute-value.
        Parameters:
        value - The String with the set of attribute-values
        n - Number of entries to return (entries will be null of there were not enough). 0 means unlimited
        Returns:
        An array of Strings which represent the individual attribute-values
        Throws:
        IllegalArgumentException - If value is null or n is negative
      • parseFrom

        public static String[] parseFrom​(String value)
                                  throws IllegalArgumentException
        Parse a String with a StringWritableCsv into its composing Strings represented as Strings. No validation is performed on the individual attribute-values returned. All the available attribute-values will be returned.
        Parameters:
        value - The String with the set of attribute-values
        Returns:
        An array of Strings which represent the individual attribute-values
        Throws:
        IllegalArgumentException - If value is null