Search in sources :

Example 1 with CondaInfo

use of com.synopsys.integration.detectable.detectables.conda.model.CondaInfo in project synopsys-detect by blackducksoftware.

the class CondaListParser method parse.

public DependencyGraph parse(String listJsonText, String infoJsonText) {
    Type listType = new TypeToken<ArrayList<CondaListElement>>() {
    }.getType();
    List<CondaListElement> condaList = gson.fromJson(listJsonText, listType);
    CondaInfo condaInfo = gson.fromJson(infoJsonText, CondaInfo.class);
    String platform = condaInfo.platform;
    DependencyGraph graph = new BasicDependencyGraph();
    condaList.stream().map(condaListElement -> dependencyCreator.createFromCondaListElement(condaListElement, platform)).forEach(graph::addChildToRoot);
    return graph;
}
Also used : List(java.util.List) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) TypeToken(com.google.gson.reflect.TypeToken) Type(java.lang.reflect.Type) Gson(com.google.gson.Gson) CondaListElement(com.synopsys.integration.detectable.detectables.conda.model.CondaListElement) BasicDependencyGraph(com.synopsys.integration.bdio.graph.BasicDependencyGraph) ArrayList(java.util.ArrayList) CondaInfo(com.synopsys.integration.detectable.detectables.conda.model.CondaInfo) Type(java.lang.reflect.Type) ArrayList(java.util.ArrayList) CondaInfo(com.synopsys.integration.detectable.detectables.conda.model.CondaInfo) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) BasicDependencyGraph(com.synopsys.integration.bdio.graph.BasicDependencyGraph) BasicDependencyGraph(com.synopsys.integration.bdio.graph.BasicDependencyGraph) CondaListElement(com.synopsys.integration.detectable.detectables.conda.model.CondaListElement)

Aggregations

Gson (com.google.gson.Gson)1 TypeToken (com.google.gson.reflect.TypeToken)1 BasicDependencyGraph (com.synopsys.integration.bdio.graph.BasicDependencyGraph)1 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)1 CondaInfo (com.synopsys.integration.detectable.detectables.conda.model.CondaInfo)1 CondaListElement (com.synopsys.integration.detectable.detectables.conda.model.CondaListElement)1 Type (java.lang.reflect.Type)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1