com.capitalone.dashboard.model.KeyValueLog Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Core package shared by API layer and Microservices
package com.capitalone.dashboard.model;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
public class KeyValueLog {
private static final char SEPERATOR = ' ';
private static final char EQUALS = '=';
private static final char QUOTE = '"';
private StringBuilder builder = new StringBuilder();
private Map attributes = new LinkedHashMap<>();
public KeyValueLog with(String key, Object value) {
attributes.put(key, value);
return this;
}
@Override
public String toString() {
Set keySet = attributes.keySet();
for(String key : keySet) {
builder.append(key).append(EQUALS).append(QUOTE).append(attributes.get(key)).append(QUOTE).append(SEPERATOR);
}
return builder.toString().trim();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy