com.braintreegateway.util.MapUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.servicemix.bundles.braintree-java
Show all versions of org.apache.servicemix.bundles.braintree-java
This OSGi bundle wraps ${pkgArtifactId} ${pkgVersion} jar file.
The newest version!
package com.braintreegateway.util;
import java.util.HashMap;
import java.util.Map;
public class MapUtils {
public static Map toMap(Object... args) {
if (args.length % 2 == 1) {
throw new RuntimeException("toMap must be called with an even number of parameters");
}
HashMap map = new HashMap();
for (int i = 0; i < args.length; i += 2) {
String key = String.valueOf(args[i]);
Object value = args[i + 1];
map.put(key, value);
}
return map;
}
}