Source:
<code>NetworkConfig getNetworkConfig() { String net = asString("network_mode"); if (net != null) { return new NetworkConfig(net); } Object networks = asObject("networks"); if (networks == null) { return null; } if (networks instanceof List) { List<String> toJoin = (List<String>) networks; if (toJoin.size() > 1) { throwIllegalArgumentException("'networks:' Only one custom network to join is supported currently"); } return new NetworkConfig(NetworkConfig.Mode.custom, toJoin.get(0)); } else if (networks instanceof Map) { Map<String,Object> toJoin = (Map<String, Object>) networks; if (toJoin.size() > 1) { throwIllegalArgumentException("'networks:' Only one custom network to join is supported currently"); } String custom = toJoin.keySet().iterator().next(); NetworkConfig ret = new NetworkConfig(NetworkConfig.Mode.custom, custom); Object aliases = toJoin.get(custom); if (aliases != null) { if (aliases instanceof List) { for (String alias : (List<String>) aliases) { ret.addAlias(alias); } <START> } else if (aliases instanceof LinkedHashMap) { <END> LinkedHashMap<String, ArrayList<String>> map = (LinkedHashMap<String, ArrayList<String>>) aliases; if (map.containsKey("aliases")) { for (String alias : map.get("aliases")) { ret.addAlias(alias); } } else { throwIllegalArgumentException( "'networks:' Aliases must be given as a linked has map of strings. 'aliases' key not founded"); } } else { throwIllegalArgumentException("'networks:' Aliases must be given as a list of string "); } } return ret; } else { throwIllegalArgumentException("'networks:' must beu either a list or a map"); return null; } }</code><technical_language>check for Map</technical_language>

Target:
NetworkConfig getNetworkConfig() { String net = asString("network_mode"); if (net != null) { return new NetworkConfig(net); } Object networks = asObject("networks"); if (networks == null) { return null; } if (networks instanceof List) { List<String> toJoin = (List<String>) networks; if (toJoin.size() > 1) { throwIllegalArgumentException("'networks:' Only one custom network to join is supported currently"); } return new NetworkConfig(NetworkConfig.Mode.custom, toJoin.get(0)); } else if (networks instanceof Map) { Map<String,Object> toJoin = (Map<String, Object>) networks; if (toJoin.size() > 1) { throwIllegalArgumentException("'networks:' Only one custom network to join is supported currently"); } String custom = toJoin.keySet().iterator().next(); NetworkConfig ret = new NetworkConfig(NetworkConfig.Mode.custom, custom); Object aliases = toJoin.get(custom); if (aliases != null) { if (aliases instanceof List) { for (String alias : (List<String>) aliases) { ret.addAlias(alias); } } else if (aliases instanceof Map) { Map<String, List<String>> map = (Map<String, List<String>>) aliases; if (map.containsKey("aliases")) { for (String alias : map.get("aliases")) { ret.addAlias(alias); } } else { throwIllegalArgumentException( "'networks:' Aliases must be given as a map of strings. 'aliases' key not founded"); } } else { throwIllegalArgumentException("'networks:' No aliases entry found in network config map"); } } return ret; } else { throwIllegalArgumentException("'networks:' must beu either a list or a map"); return null; } }