Class StringWritableCsv


  • final class StringWritableCsv
    extends java.lang.Object
    Helper class to generate Comma Separated Values of StringWritables.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private StringWritableCsv()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static @NotNull java.lang.String @NotNull [] parseFrom​(@NotNull java.lang.String value)
      Parse a String with a StringWritableCsv into its composing Strings represented as Strings.
      (package private) static @NotNull java.lang.String @NotNull [] parseFrom​(@NotNull java.lang.String value, int n)
      Parse a String with a StringWritableCsv into its composing Strings represented as Strings.
      (package private) static @NotNull java.lang.String @NotNull [] parseFrom​(@NotNull java.lang.String value, int n, int offset)
      Parse a String with a StringWritableCsv into its composing Strings represented as Strings.
      (package private) static @NotNull java.lang.StringBuilder writeTo​(@NotNull java.lang.StringBuilder sb, @Nullable StringWritable... values)
      Write a sequence of StringWritableCsv to a StringBuffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringWritableCsv

        private StringWritableCsv()
    • Method Detail

      • writeTo

        @NotNull
        static @NotNull java.lang.StringBuilder writeTo​(@NotNull
                                                        @NotNull java.lang.StringBuilder sb,
                                                        @Nullable
                                                        @Nullable StringWritable... values)
        Write a sequence of StringWritableCsv to a StringBuffer. Null StringWritables are not printed, but separator is still used. Separator is a comma (',')
        Parameters:
        sb - The sb to write to
        values - Zero or more attribute-value pairs to write
        Returns:
        The same sb, with data filled in (if any)
        Throws:
        java.lang.IllegalArgumentException - If sb is null
      • parseFrom

        @NotNull
        static @NotNull java.lang.String @NotNull [] parseFrom​(@NotNull
                                                               @NotNull java.lang.String value,
                                                               int n,
                                                               int offset)
        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:
        java.lang.IllegalArgumentException - If value is null or either n or offset are negative
      • parseFrom

        @NotNull
        static @NotNull java.lang.String @NotNull [] parseFrom​(@NotNull
                                                               @NotNull java.lang.String value,
                                                               int n)
        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:
        java.lang.IllegalArgumentException - If value is null or n is negative
      • parseFrom

        @NotNull
        static @NotNull java.lang.String @NotNull [] parseFrom​(@NotNull
                                                               @NotNull java.lang.String value)
        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:
        java.lang.IllegalArgumentException - If value is null