org.sonar.api.utils
Class KeyValueFormat

java.lang.Object
  extended by org.sonar.api.utils.KeyValueFormat

public final class KeyValueFormat
extends Object

Util class to format key/value data. Output is a string representation ready to be injected into the database

Since:
1.10

Nested Class Summary
static class KeyValueFormat.DoubleNumbersPairTransformer
           
static class KeyValueFormat.IntegerNumbersPairTransformer
           
static class KeyValueFormat.StringNumberPairTransformer
           
static interface KeyValueFormat.Transformer<KEY,VALUE>
           
 
Method Summary
static String format(org.apache.commons.collections.Bag bag)
          Please use Multiset from google collections instead of commons-collections bags.
static String format(org.apache.commons.collections.Bag bag, int var)
          Please use Multiset from google collections instead of commons-collections bags.
static
<KEY,VALUE>
String
format(Map<KEY,VALUE> map)
           
static String format(com.google.common.collect.Multiset<?> set)
           
static String format(Object... objects)
           
static Map<String,String> parse(String data)
           
static
<KEY,VALUE>
Map<KEY,VALUE>
parse(String data, KeyValueFormat.Transformer<KEY,VALUE> transformer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static <KEY,VALUE> Map<KEY,VALUE> parse(String data,
                                               KeyValueFormat.Transformer<KEY,VALUE> transformer)

parse

public static Map<String,String> parse(String data)

format

public static <KEY,VALUE> String format(Map<KEY,VALUE> map)

format

public static String format(org.apache.commons.collections.Bag bag)
Please use Multiset from google collections instead of commons-collections bags.


format

public static String format(org.apache.commons.collections.Bag bag,
                            int var)
Please use Multiset from google collections instead of commons-collections bags.


format

public static String format(com.google.common.collect.Multiset<?> set)

format

public static String format(Object... objects)


Copyright © 2009 SonarSource SA. All Rights Reserved.