Gets a list from an object for the given key, and verifies all entries are objects. If the key is not present, this returns null. If the value is not a List or an entry is not an object, throws an exception.
(Map<String, ?> obj, String key)
| 54 | * throws an exception. |
| 55 | */ |
| 56 | @Nullable |
| 57 | public static List<Map<String, ?>> getListOfObjects(Map<String, ?> obj, String key) { |
| 58 | List<?> list = getList(obj, key); |
| 59 | if (list == null) { |
| 60 | return null; |
| 61 | } |
| 62 | return checkObjectList(list); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Gets a list from an object for the given key, and verifies all entries are strings. If the key |