generator/api/src/main/java/io/fabric8/maven/generator/api/support/AbstractPortsExtractor.java
private Map<String, String> flatten(Map map) {
        Map<String, String> flat = new HashMap<>();
        for (Object key : map.keySet()) {
            String stringKey = String.valueOf(key);
            Object value = map.get(key);
            if (value instanceof String) {
                flat.put(stringKey, (String) value);
            } else if (value instanceof Map) {
                for (Map.Entry<String, String> entry : flatten((Map) value).entrySet()) {
                    flat.put(
                            new StringBuilder(stringKey).append(DOT).append(entry.getKey()).toString(),
                            entry.getValue());
                }
            } else {
                flat.put(stringKey, String.valueOf(value));
            }
        }
        return flat;
    }
private Map<String, String> flatten(Map map) {
        Map<String, String> flat = new HashMap<>();
        for (Object key : map.keySet()) {
            String stringKey = String.valueOf(key);
            Object value = map.get(key);
            if (value instanceof String) {
                flat.put(stringKey, (String) value);
            } else if (value instanceof Map) {
                for (Map.Entry<String, String> entry : flatten((Map) value).entrySet()) {
                    flat.put(
                            new StringBuilder(stringKey).append(DOT).append(entry.getKey()).toString(),
                            entry.getValue());
                }
            } else {
                flat.put(stringKey, String.valueOf(value));
            }
        }
        return flat;
    }
private Map < String , String > flatten ( Map map ) { Map < String , String > flat = new HashMap <> ( ) ; for ( Object key : map . keySet ( ) ) { String stringKey = String . valueOf ( key ) ; Object value = map . get ( key ) ; if ( value instanceof String ) { flat . put ( stringKey , ( String ) value ) ; } else if ( value instanceof Map ) { for ( Map . Entry < String , String > entry : flatten ( ( Map ) value ) . entrySet ( ) ) { flat . put ( new StringBuilder ( stringKey ) . append ( DOT ) . append ( entry . getKey ( ) ) . toString ( ) , entry . getValue ( ) ) ; } } else { flat . put ( stringKey , String . valueOf ( value ) ) ; } } return flat ; }
Flattens a nested map into a Map<String, String>.
@param map   The target map.
@return      The flattened map.
Flattens a nested map into a Map<String String > .