
com.newrelic.agent.attributes.AttributesUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of newrelic-agent Show documentation
Show all versions of newrelic-agent Show documentation
Jar required to run with a java application to monitor performance.
The newest version!
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/
package com.newrelic.agent.attributes;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class AttributesUtils {
public static Map appendAttributePrefixes(Map> input) {
if (input == null || input.isEmpty()) {
return Collections.emptyMap();
}
Map toReturn = new HashMap<>();
String prefix;
Map attributes;
for (Entry> current : input.entrySet()) {
prefix = current.getKey();
attributes = current.getValue();
if (attributes != null) {
for (Entry att : attributes.entrySet()) {
toReturn.put(prefix + att.getKey(), att.getValue());
}
}
}
return toReturn;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy