Skip to content

Commit

Permalink
remove some more TODOs from ParsedAggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
javanna committed May 22, 2017
1 parent 3e472ae commit 853427f
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
*/
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);
Expand All @@ -60,10 +59,7 @@ public final Map<String, Object> getMetaData() {
//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) {
Expand Down

0 comments on commit 853427f

Please sign in to comment.