remove some more TODOs from ParsedAggregation
@@ -33,7 +33,6 @@ import java.util.Map;
*/
public abstract class ParsedAggregation implements Aggregation, ToXContent {
- //TODO move CommonFields out of InternalAggregation
protected static void declareCommonFields(ObjectParser<? extends ParsedAggregation, Void> objectParser) {
objectParser.declareObject((parsedAgg, metadata) -> parsedAgg.metadata = Collections.unmodifiableMap(metadata),
(parser, context) -> parser.map(), InternalAggregation.CommonFields.META);
@@ -60,10 +59,7 @@ public abstract class ParsedAggregation implements Aggregation, ToXContent {
//TODO it may make sense to move getType to the Aggregation interface given that we are duplicating it in both implementations
protected abstract String getType();
- //TODO the only way to avoid duplicating this method is making Aggregation extend ToXContent
- //and declare toXContent as a default method in it. Doesn't sound like the right thing to do.
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
- //TODO move TYPED_KEYS_DELIMITER constant out of InternalAggregation
// Concatenates the type and the name of the aggregation (ex: top_hits#foo)
builder.startObject(String.join(InternalAggregation.TYPED_KEYS_DELIMITER, getType(), name));
if (this.metadata != null) {
