com.datarobot.util.PrettyPrintingMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datarobot-ai-java Show documentation
Show all versions of datarobot-ai-java Show documentation
This java client library allows you to quickly and easily communicate with the
DataRobot AI API to add Machine Learning to your applications.
The newest version!
package com.datarobot.util;
import java.util.Iterator;
import java.util.Map;
public class PrettyPrintingMap {
private Map map;
public PrettyPrintingMap(Map map) {
this.map = map;
}
public String toString() {
StringBuilder sb = new StringBuilder();
Iterator> iter = map.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = iter.next();
sb.append(entry.getKey());
sb.append('=').append('"');
sb.append(entry.getValue());
sb.append('"');
if (iter.hasNext()) {
sb.append(',').append(' ');
}
}
return sb.toString();
}
}