Java api: fixed inconsistencies in PercolateRequest, added return type for method chaining where missing

Closes #7294
This commit is contained in:
javanna 2014-08-15 15:53:40 +02:00 committed by Luca Cavanna
parent 5c7cefa292
commit d0e2d768b8
1 changed files with 7 additions and 3 deletions

View File

@ -88,8 +88,9 @@ public class PercolateRequest extends BroadcastOperationRequest<PercolateRequest
return documentType;
}
public void documentType(String type) {
public PercolateRequest documentType(String type) {
this.documentType = type;
return this;
}
public String routing() {
@ -114,8 +115,9 @@ public class PercolateRequest extends BroadcastOperationRequest<PercolateRequest
return getRequest;
}
public void getRequest(GetRequest getRequest) {
public PercolateRequest getRequest(GetRequest getRequest) {
this.getRequest = getRequest;
return this;
}
/**
@ -137,6 +139,7 @@ public class PercolateRequest extends BroadcastOperationRequest<PercolateRequest
return source(document, Requests.CONTENT_TYPE);
}
@SuppressWarnings("unchecked")
public PercolateRequest source(Map document, XContentType contentType) throws ElasticsearchGenerationException {
try {
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
@ -187,8 +190,9 @@ public class PercolateRequest extends BroadcastOperationRequest<PercolateRequest
return onlyCount;
}
public void onlyCount(boolean onlyCount) {
public PercolateRequest onlyCount(boolean onlyCount) {
this.onlyCount = onlyCount;
return this;
}
BytesReference docSource() {