Package com.ongres.scram.common
Class StringWritableCsv
java.lang.Object
com.ongres.scram.common.StringWritableCsv
Helper class to generate Comma Separated Values of StringWritables.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String[]
Parse a String with a StringWritableCsv into its composing Strings represented as Strings.(package private) static String[]
Parse a String with a StringWritableCsv into its composing Strings represented as Strings.(package private) static String[]
Parse a String with a StringWritableCsv into its composing Strings represented as Strings.(package private) static StringBuilder
writeTo
(StringBuilder sb, StringWritable... values) Write a sequence of StringWritableCsv to a StringBuffer.
-
Constructor Details
-
StringWritableCsv
private StringWritableCsv()
-
-
Method Details
-
writeTo
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 tovalues
- Zero or more attribute-value pairs to write- Returns:
- The same sb, with data filled in (if any)
- Throws:
IllegalArgumentException
- If sb is null
-
parseFrom
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-valuesn
- Number of entries to return (entries will be null of there were not enough). 0 means unlimitedoffset
- 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
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-valuesn
- 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
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
-