From 44ea1efd26b973756138b49ec8463ae27b0f0f55 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 10 Feb 2020 09:23:08 +0100 Subject: [PATCH] Tidy up GetSourceRequest class: (#51916) * No need to implement ToXContentObject * Made index and id fields immutable. --- .../client/core/GetSourceRequest.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceRequest.java index 10b9b984bec..e7ca74fc61b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceRequest.java @@ -21,13 +21,9 @@ package org.elasticsearch.client.core; import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; -import java.io.IOException; - -public final class GetSourceRequest implements Validatable, ToXContentObject { +public final class GetSourceRequest implements Validatable { private String routing; private String preference; @@ -36,9 +32,9 @@ public final class GetSourceRequest implements Validatable, ToXContentObject { private FetchSourceContext fetchSourceContext; - private String index; + private final String index; private String type; - private String id; + private final String id; public GetSourceRequest(String index, String id) { this.index = index; @@ -102,11 +98,6 @@ public final class GetSourceRequest implements Validatable, ToXContentObject { return this; } - @Override - public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - return null; - } - public String index() { return index; }