private Mode extractMode(String mode) {
        if (mode != null && mode.length() > 0) {
            try {
                return Mode.valueOf(mode.toLowerCase());
            } catch (IllegalArgumentException exp) { /* could be a custom mode, too */ }
            if (mode.toLowerCase().startsWith(Mode.container.name() + ":")) {
                return Mode.container;
            } else {
                return Mode.custom;
            }
        }
        return null;
    }
Legacy constructor using the &lt;net&gt; config
@param net net, encapsulating mode &amp; name.
src/main/java/io/fabric8/maven/docker/config/NetworkConfig.java