io.keen.client.java.result.MultiAnalysisResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of keen-client-api-query Show documentation
Show all versions of keen-client-api-query Show documentation
Java Query Client API for Keen IO
package io.keen.client.java.result;
import java.util.Collections;
import java.util.Map;
/**
* Represents a mapping of sub-analysis labels, as specified in a MultiAnalysis, to QueryResults.
*
* @author masojus
*/
public class MultiAnalysisResult extends QueryResult {
private final Map analysesResults;
/**
* Constructs a MultiAnalysisResult to hold the given mapping of labels to results.
*
* @param analysesResults The map of sub-analysis labels to results.
*/
public MultiAnalysisResult(Map analysesResults) {
this.analysesResults = Collections.unmodifiableMap(analysesResults);
}
/**
* Provides the result for a sub-analysis.
*
* @param subAnalysisLabel The label that was assigned to this sub-analysis in the
* MultiAnalysis request.
* @return The result of the given sub-analysis.
*/
public QueryResult getResultFor(String subAnalysisLabel) {
if (!this.analysesResults.containsKey(subAnalysisLabel)) {
throw new IllegalArgumentException("No results for a sub-analysis with that label.");
}
return this.analysesResults.get(subAnalysisLabel);
}
/**
* Provides the mapping of all results.
*
* @return An unmodifiable mapping of all sub-analysis labels to results.
*/
public Map getAllResults() {
return this.analysesResults;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy