Data: support non-string values in DataHelper.toString(Map)

This commit is contained in:
zzz
2018-11-13 17:53:33 +00:00
parent 9377b57c9e
commit ddfc7c05ef

View File

@ -400,14 +400,14 @@ public class DataHelper {
/** /**
* Pretty print the mapping, unsorted * Pretty print the mapping, unsorted
* (unless the options param is an OrderedProperties) * (unless the options param is an OrderedProperties)
* @since 0.9.4 * @since 0.9.4, as of 0.9.38 supports non-String values
*/ */
public static String toString(Map<?, ?> options) { public static String toString(Map<?, ?> options) {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
if (options != null) { if (options != null) {
for (Map.Entry<?, ?> entry : options.entrySet()) { for (Map.Entry<?, ?> entry : options.entrySet()) {
String key = (String) entry.getKey(); String key = (String) entry.getKey();
String val = (String) entry.getValue(); String val = entry.getValue().toString();
buf.append("[").append(key).append("] = [").append(val).append("]"); buf.append("[").append(key).append("] = [").append(val).append("]");
} }
} else { } else {