use of org.n52.iceland.statistics.api.parameters.SingleEsParameter in project arctic-sea by 52North.
the class DefaultElasticsearchSchemas method resolveParameterField.
private void resolveParameterField(AbstractEsParameter value, Map<String, Object> map) {
if (value instanceof SingleEsParameter) {
SingleEsParameter single = (SingleEsParameter) value;
map.put(single.getName(), single.getTypeAsMap());
} else if (value instanceof ObjectEsParameter) {
ObjectEsParameter object = (ObjectEsParameter) value;
// loadup all the children
// the wrapper properties map is needed to elasticsearch
Map<String, Object> subproperties = new HashMap<>(1);
Map<String, Object> childrenMap = new HashMap<>(value.getAllChildren().size());
subproperties.put(PROPERTIES_KEY, childrenMap);
for (AbstractEsParameter child : object.getAllChildren()) {
resolveParameterField(child, childrenMap);
}
map.put(object.getName(), subproperties);
} else {
throw new IllegalArgumentException("Invalid schema parameter value " + value.toString());
}
}
Aggregations