@Deprecated // use parseMap public static Map<String,String> parse(String line) { return parseMap(line); }
boolean intList = true; if (listMatcher.matches()) { List<String> strings = KeyValueParser.parseList(listMatcher.group(1)); List<Integer> integers = new ArrayList<Integer>(); for (String string : strings) {
protected static Map<String,String> toMapStringString(Object v) { if (v instanceof Map<?,?>) { Map<String,String> result = Maps.newLinkedHashMap(); for (Map.Entry<?,?> entry : ((Map<?,?>)v).entrySet()) { String key = ((CharSequence)entry.getKey()).toString(); String value = ((CharSequence)entry.getValue()).toString(); result.put(key, value); } return result; } else if (v instanceof CharSequence) { return KeyValueParser.parseMap(v.toString()); } else { throw new IllegalArgumentException("Invalid type for Map<String,String>: "+v+" of type "+v.getClass()); } }
Map<String, String> argsMap = (argsPart != null) ? KeyValueParser.parseMap(argsPart) : Collections.<String,String>emptyMap(); String namePart = argsMap.get("name");
Map<String, String> argsMap = KeyValueParser.parseMap(argsPart);
protected Location newLocationFromString(String spec, brooklyn.location.LocationRegistry registry, Map properties, Map locationFlags) { Matcher matcher = PATTERN.matcher(spec); if (!matcher.matches()) { throw new IllegalArgumentException("Invalid location '" + spec + "'; must specify something like single(named:foo)"); } String namedLocation = (String) locationFlags.get("named"); String args = matcher.group(2); Map<String,?> locationArgs = KeyValueParser.parseMap(args); Map<String, Object> filteredProperties = new LocationPropertiesFromBrooklynProperties().getLocationProperties(null, namedLocation, properties); MutableMap<String, Object> flags = MutableMap.<String, Object>builder() .putAll(filteredProperties) .putAll(locationFlags) .removeAll("named") .putAll(locationArgs).build(); if (locationArgs.get("target") == null) { throw new IllegalArgumentException("target must be specified in single-machine spec"); } String target = locationArgs.get("target").toString(); locationArgs.remove("target"); if (!managementContext.getLocationRegistry().canResolve(target)) { throw new IllegalArgumentException("Invalid target location '" + target + "'; must be resolvable location"); } return managementContext.getLocationManager().createLocation(LocationSpec.create(SingleMachineProvisioningLocation.class) .configure("location", target) .configure("locationFlags", flags)); }
Map<String, String> argsMap = KeyValueParser.parseMap(argsPart);