MCPcopy Index your code
hub / github.com/Tencent/APIJSON / getMap

Method getMap

APIJSONORM/src/main/java/apijson/JSON.java:329–341  ·  view source on GitHub ↗

Get a Map value from a Map @param map Source map @param key The key @return The Map value @throws IllegalArgumentException If value is not a Map and cannot be converted

(Map<String, Object> map, String key)

Source from the content-addressed store, hash-verified

327 * @throws IllegalArgumentException If value is not a Map and cannot be converted
328 */
329 @SuppressWarnings("unchecked")
330 public static <K, V> Map<K, V> getMap(Map<String, Object> map, String key) throws IllegalArgumentException {
331 Object value = map == null || key == null ? null : map.get(key);
332 if (value == null) {
333 return null;
334 }
335
336 if (value instanceof Map) {
337 return (Map<K, V>) value;
338 }
339
340 throw new IllegalArgumentException("Value for key '" + key + "' is not a Map: " + value.getClass().getName());
341 }
342
343 /**
344 * Get a List value from a Map

Callers 1

batchVerifyMethod · 0.95

Calls 2

getMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected