|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.utils.KeyValueFormat
public final class KeyValueFormat
Util class to format key/value data. Output is a string representation ready to be injected into the database
Nested Class Summary | |
---|---|
static class |
KeyValueFormat.DoubleNumbersPairTransformer
Implementation of Transformer |
static class |
KeyValueFormat.IntegerNumbersPairTransformer
Implementation of Transformer |
static class |
KeyValueFormat.RulePriorityNumbersPairTransformer
Implementation of Transformer |
static class |
KeyValueFormat.StringNumberPairTransformer
Implementation of Transformer |
static interface |
KeyValueFormat.Transformer<KEY,VALUE>
|
Method Summary | ||
---|---|---|
static java.lang.String |
format(org.apache.commons.collections.Bag bag)
Deprecated. use Multiset from google collections instead of commons-collections bags |
|
static java.lang.String |
format(org.apache.commons.collections.Bag bag,
int var)
Deprecated. use Multiset from google collections instead of commons-collections bags |
|
static
|
format(java.util.Map<KEY,VALUE> map)
Transforms a map |
|
static java.lang.String |
format(com.google.common.collect.Multiset<?> set)
Transforms a Multiset> into a string with the format : "key1=count1;key2=count2..." |
|
static java.lang.String |
format(java.lang.Object... objects)
Transforms a Object... |
|
static java.util.Map<java.lang.String,java.lang.String> |
parse(java.lang.String data)
Transforms a string with the following format : "key1=value1;key2=value2..." into a Map |
|
static
|
parse(java.lang.String data,
KeyValueFormat.Transformer<KEY,VALUE> transformer)
Transforms a string with the following format : "key1=value1;key2=value2..." into a Map |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <KEY,VALUE> java.util.Map<KEY,VALUE> parse(java.lang.String data, KeyValueFormat.Transformer<KEY,VALUE> transformer)
data
- the input stringtransformer
- the interface to implement
public static java.util.Map<java.lang.String,java.lang.String> parse(java.lang.String data)
data
- the string to parse
public static <KEY,VALUE> java.lang.String format(java.util.Map<KEY,VALUE> map)
map
- the map to transform
public static java.lang.String format(org.apache.commons.collections.Bag bag)
public static java.lang.String format(org.apache.commons.collections.Bag bag, int var)
public static java.lang.String format(com.google.common.collect.Multiset<?> set)
set
- the set to transform
public static java.lang.String format(java.lang.Object... objects)
objects
- the object list to transform
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |