From: Simon Brandhof Date: Thu, 16 Aug 2012 16:16:43 +0000 (+0200) Subject: Add tip for parsing KeyValueFormat format from ruby code X-Git-Tag: 3.3~338 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6c8a4634f28f50fbcebcc557316f6a24130527ee;p=sonarqube.git Add tip for parsing KeyValueFormat format from ruby code --- diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java index 6f004c963ba..0f6ebd7103c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java @@ -34,8 +34,10 @@ import java.text.SimpleDateFormat; import java.util.*; /** - * Formats and parses key/value pairs with the string representation : "key1=value1;key2=value2". Conversion - * of fields is supported and can be extended. + *

Formats and parses key/value pairs with the string representation : "key1=value1;key2=value2". Conversion + * of fields is supported and can be extended.

+ * + *

This format can easily be parsed with Ruby code: hash=Hash[*(my_string.split(';').map { |elt| elt.split('=') }.flatten)]

* * @since 1.10 */