Skip to content

Commit b402ea2

Browse files
authored
Tidy up GetSourceRequest class: (elastic#51916)
* No need to implement ToXContentObject * Made index and id fields immutable.
1 parent 8b6e6a1 commit b402ea2

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceRequest.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@
2121

2222
import org.elasticsearch.action.get.GetRequest;
2323
import org.elasticsearch.client.Validatable;
24-
import org.elasticsearch.common.xcontent.ToXContentObject;
25-
import org.elasticsearch.common.xcontent.XContentBuilder;
2624
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
2725

28-
import java.io.IOException;
29-
30-
public final class GetSourceRequest implements Validatable, ToXContentObject {
26+
public final class GetSourceRequest implements Validatable {
3127
private String routing;
3228
private String preference;
3329

@@ -36,8 +32,8 @@ public final class GetSourceRequest implements Validatable, ToXContentObject {
3632

3733
private FetchSourceContext fetchSourceContext;
3834

39-
private String index;
40-
private String id;
35+
private final String index;
36+
private final String id;
4137

4238
public GetSourceRequest(String index, String id) {
4339
this.index = index;
@@ -101,11 +97,6 @@ public GetSourceRequest fetchSourceContext(FetchSourceContext context) {
10197
return this;
10298
}
10399

104-
@Override
105-
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
106-
return null;
107-
}
108-
109100
public String index() {
110101
return index;
111102
}

0 commit comments

Comments
 (0)