Tidy up GetSourceRequest class: (#51916)

* No need to implement ToXContentObject
* Made index and id fields immutable.
This commit is contained in:
Martijn van Groningen 2020-02-10 09:23:08 +01:00
parent 3edadfefd0
commit 44ea1efd26
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
1 changed files with 3 additions and 12 deletions

View File

@ -21,13 +21,9 @@ package org.elasticsearch.client.core;
import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.client.Validatable; 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 org.elasticsearch.search.fetch.subphase.FetchSourceContext;
import java.io.IOException; public final class GetSourceRequest implements Validatable {
public final class GetSourceRequest implements Validatable, ToXContentObject {
private String routing; private String routing;
private String preference; private String preference;
@ -36,9 +32,9 @@ public final class GetSourceRequest implements Validatable, ToXContentObject {
private FetchSourceContext fetchSourceContext; private FetchSourceContext fetchSourceContext;
private String index; private final String index;
private String type; private String type;
private String id; private final String id;
public GetSourceRequest(String index, String id) { public GetSourceRequest(String index, String id) {
this.index = index; this.index = index;
@ -102,11 +98,6 @@ public final class GetSourceRequest implements Validatable, ToXContentObject {
return this; return this;
} }
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return null;
}
public String index() { public String index() {
return index; return index;
} }