All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fabric8.maven.docker.model.ImageArchiveManifestAdapter Maven / Gradle / Ivy

There is a newer version: 0.45.0
Show newest version
package io.fabric8.maven.docker.model;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

public class ImageArchiveManifestAdapter implements ImageArchiveManifest {
    private List entries;

    private Map config;

    public ImageArchiveManifestAdapter(JsonElement json) {
        this.entries = new ArrayList<>();

        if(json.isJsonArray()) {
            for(JsonElement entryJson : json.getAsJsonArray()) {
                if(entryJson.isJsonObject()) {
                    this.entries.add(new ImageArchiveManifestEntryAdapter(entryJson.getAsJsonObject()));
                }
            }
        }

        this.config = new LinkedHashMap<>();
    }

    @Override
    public List getEntries() {
        return this.entries;
    }

    @Override
    public JsonObject getConfig(String configName) {
        return this.config.get(configName);
    }

    public JsonObject putConfig(String configName, JsonObject config) {
        return this.config.put(configName, config);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy