mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-16 07:10:48 +00:00
The ModifiableStatisticQueryDefinitionDTO is now fully modifiable
This commit is contained in:
1 parent
883ef89b51
commit
cd0ee770a3
3 files changed
+56
-15
No files matched your search
+53
-12
@@ -34,52 +34,93 @@ public class ModifiableStatisticQueryDefinitionDTO implements StatisticQueryDefi
|
||||
this.filterSelection = new HashMap<>();
|
||||
this.dimensionsToGroupBy = new ArrayList<FunctionDTO>();
|
||||
}
|
||||
|
||||
public void setRetrieverSettings(DataRetrieverLevelDTO retrieverLevel, SerializableSettings settings) {
|
||||
retrieverSettings.put(retrieverLevel, settings);
|
||||
}
|
||||
|
||||
public void setFilterSelectionFor(DataRetrieverLevelDTO retrieverLevel, HashMap<FunctionDTO, HashSet<? extends Serializable>> levelFilterSelection) {
|
||||
filterSelection.put(retrieverLevel, levelFilterSelection);
|
||||
}
|
||||
|
||||
public void appendDimensionToGroupBy(FunctionDTO dimensionToGroupBy) {
|
||||
dimensionsToGroupBy.add(dimensionToGroupBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocaleInfoName() {
|
||||
return localeInfoName;
|
||||
}
|
||||
|
||||
public void setLocaleInfoName(String localeInfoName) {
|
||||
if (localeInfoName == null) {
|
||||
throw new NullPointerException("The locale info name mustn't be null");
|
||||
}
|
||||
this.localeInfoName = localeInfoName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataRetrieverChainDefinitionDTO getDataRetrieverChainDefinition() {
|
||||
return dataRetrieverChainDefinition;
|
||||
}
|
||||
|
||||
public void setDataRetrieverChainDefinition(DataRetrieverChainDefinitionDTO dataRetrieverChainDefinition) {
|
||||
if (dataRetrieverChainDefinition == null) {
|
||||
throw new NullPointerException("The data retriever chain definition mustn't be null");
|
||||
}
|
||||
this.dataRetrieverChainDefinition = dataRetrieverChainDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<DataRetrieverLevelDTO, SerializableSettings> getRetrieverSettings() {
|
||||
return retrieverSettings;
|
||||
}
|
||||
|
||||
public void setRetrieverSettings(DataRetrieverLevelDTO retrieverLevel, SerializableSettings settings) {
|
||||
if (retrieverLevel == null) {
|
||||
throw new NullPointerException("The retriever level mustn't be null");
|
||||
}
|
||||
retrieverSettings.put(retrieverLevel, settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<DataRetrieverLevelDTO, HashMap<FunctionDTO, HashSet<? extends Serializable>>> getFilterSelection() {
|
||||
return filterSelection;
|
||||
}
|
||||
|
||||
public void setFilterSelectionFor(DataRetrieverLevelDTO retrieverLevel, HashMap<FunctionDTO, HashSet<? extends Serializable>> levelFilterSelection) {
|
||||
if (retrieverLevel == null) {
|
||||
throw new NullPointerException("The retriever level mustn't be null");
|
||||
}
|
||||
if (levelFilterSelection == null) {
|
||||
throw new NullPointerException("The level filter selection mustn't be null");
|
||||
}
|
||||
|
||||
filterSelection.put(retrieverLevel, levelFilterSelection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<FunctionDTO> getDimensionsToGroupBy() {
|
||||
return dimensionsToGroupBy;
|
||||
}
|
||||
|
||||
public void appendDimensionToGroupBy(FunctionDTO dimensionToGroupBy) {
|
||||
if (dimensionToGroupBy == null) {
|
||||
throw new NullPointerException("The dimension mustn't be null");
|
||||
}
|
||||
dimensionsToGroupBy.add(dimensionToGroupBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FunctionDTO getStatisticToCalculate() {
|
||||
return statisticToCalculate;
|
||||
}
|
||||
|
||||
public void setStatisticToCalculate(FunctionDTO statisticToCalculate) {
|
||||
if (statisticToCalculate == null) {
|
||||
throw new NullPointerException("The statistic to calculate mustn't be null");
|
||||
}
|
||||
this.statisticToCalculate = statisticToCalculate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AggregationProcessorDefinitionDTO getAggregatorDefinition() {
|
||||
return aggregatorDefinition;
|
||||
}
|
||||
|
||||
public void setAggregatorDefinition(AggregationProcessorDefinitionDTO aggregatorDefinition) {
|
||||
if (aggregatorDefinition == null) {
|
||||
throw new NullPointerException("The aggregator definition mustn't be null");
|
||||
}
|
||||
this.aggregatorDefinition = aggregatorDefinition;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,7 +36,7 @@ import com.sap.sse.i18n.ResourceBundleStringMessages;
|
||||
public class QueryFactory {
|
||||
|
||||
public <DataSourceType, DataType, ExtractedType, ResultType> Query<ResultType> createQuery(DataSourceType dataSource, StatisticQueryDefinition<DataSourceType, DataType, ExtractedType, ResultType> queryDefinition,
|
||||
ResourceBundleStringMessages stringMessages, ExecutorService executor) {
|
||||
ResourceBundleStringMessages stringMessages, ExecutorService executor) {
|
||||
return new ProcessorQuery<ResultType, DataSourceType>(dataSource, stringMessages, queryDefinition.getLocale(), queryDefinition.getResultType(), new AdditionalStatisticQueryData()) {
|
||||
@Override
|
||||
protected Processor<DataSourceType, ?> createChainAndReturnFirstProcessor(Processor<Map<GroupKey, ResultType>, Void> resultReceiver) {
|
||||
|
||||
+2
-2
@@ -187,8 +187,8 @@ public class SimpleDataRetrieverChainBuilder<DataSourceType> implements DataRetr
|
||||
|
||||
SerializableSettings settings = null;
|
||||
if (settingsType != null) {
|
||||
settings = this.settings.containsKey(retrieverLevelIndex) ? this.settings.get(retrieverLevelIndex)
|
||||
: retrieverLevels.get(retrieverLevelIndex).getDefaultSettings();
|
||||
SerializableSettings storedSettings = this.settings.get(retrieverLevelIndex);
|
||||
settings = storedSettings != null ? storedSettings : retrieverLevels.get(retrieverLevelIndex).getDefaultSettings();
|
||||
}
|
||||
return constructRetriever(retrieverConstructor, retrievedDataType, resultReceivers, filter, settings, settingsType, retrieverLevelIndex);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user