public class StringWritableCsv extends Object
StringWritable
sConstructor and Description |
---|
StringWritableCsv() |
Modifier and Type | Method and Description |
---|---|
static String[] |
parseFrom(String value)
Parse a String with a
StringWritableCsv into its composing Strings
represented as Strings. |
static String[] |
parseFrom(String value,
int n)
Parse a String with a
StringWritableCsv into its composing Strings
represented as Strings. |
static String[] |
parseFrom(String value,
int n,
int offset)
Parse a String with a
StringWritableCsv into its composing Strings
represented as Strings. |
static StringBuffer |
writeTo(StringBuffer sb,
StringWritable... values)
Write a sequence of
StringWritableCsv s to a StringBuffer. |
public static StringBuffer writeTo(StringBuffer sb, StringWritable... values) throws IllegalArgumentException
StringWritableCsv
s to a StringBuffer.
Null StringWritable
s are not printed, but separator is still used.
Separator is a comma (',')sb
- The sb to write tovalues
- Zero or more attribute-value pairs to writeIllegalArgumentException
- If sb is nullpublic static String[] parseFrom(String value, int n, int offset) throws IllegalArgumentException
StringWritableCsv
into its composing Strings
represented as Strings. No validation is performed on the individual attribute-values returned.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 returningIllegalArgumentException
- If value is null or either n or offset are negativepublic static String[] parseFrom(String value, int n) throws IllegalArgumentException
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.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 unlimitedIllegalArgumentException
- If value is null or n is negativepublic static String[] parseFrom(String value) throws IllegalArgumentException
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.value
- The String with the set of attribute-valuesIllegalArgumentException
- If value is nullCopyright © 2017. All rights reserved.