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

Method getList

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

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

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

Source from the content-addressed store, hash-verified

348 * @throws IllegalArgumentException If value is not a List and cannot be converted
349 */
350 @SuppressWarnings("unchecked")
351 public static <T> List<T> getList(Map<String, Object> map, String key) throws IllegalArgumentException {
352 Object value = map == null || key == null ? null : map.get(key);
353 if (value == null) {
354 return null;
355 }
356
357 if (value instanceof List) {
358 return (List<T>) value;
359 }
360
361 throw new IllegalArgumentException("Value for key '" + key + "' is not a List: " + value.getClass().getName());
362 }
363
364 /**
365 * Get an int value from a Map

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected