forked from I2P_Developers/i2p.i2p
Data: support non-string values in DataHelper.toString(Map)
This commit is contained in:
@ -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 {
|
||||||
|
Reference in New Issue
Block a user