Tidy up GetSourceRequest class: (#51916)
* No need to implement ToXContentObject * Made index and id fields immutable.
This commit is contained in:
parent
3edadfefd0
commit
44ea1efd26
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue