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

com.redhat.ceylon.cmr.api.ModuleVersionResult Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
package com.redhat.ceylon.cmr.api;

import java.util.NavigableMap;
import java.util.TreeMap;

public class ModuleVersionResult {
    private String name;
    private NavigableMap versions = new TreeMap();

    public ModuleVersionResult(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public ModuleVersionDetails addVersion(String module, String version) {
        if(versions.containsKey(version))
            return null;
        ModuleVersionDetails newVersion = new ModuleVersionDetails(module, version);
        versions.put(version, newVersion);
        return newVersion;
    }

    public ModuleVersionDetails addVersion(ModuleVersionDetails version) {
        if(versions.containsKey(version.getVersion()))
            return null;
        versions.put(version.getVersion(), version);
        return version;
    }

    public NavigableMap getVersions() {
        return versions;
    }

    public boolean hasVersion(String version) {
        return versions.containsKey(version);
    }

    @Override
    public String toString() {
        return "ModuleVersionResult[name=" + name + ",versions=" + versions + "]";
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy