public String toJson() {
        JsonObject auths = new JsonObject();
        for (AuthConfig authConfig: authConfigs) {
            JsonObject auth = authConfig.toJsonObject().getAsJsonObject("auths");
            for (Map.Entry<String, JsonElement> entry : auth.entrySet()) {
                auths.add(entry.getKey(), entry.getValue());
            }
        }
        JsonObject root = new JsonObject();
        if (auths.size() > 0) {
            root.add("auths", auths);
        }

        return root.toString();
    }
Container for multiple {@link AuthConfig} objects
src/main/java/io/fabric8/maven/docker/access/AuthConfigList.java