Skip to content

Commit

Permalink
Java API: package private getters to become public if there have corr…
Browse files Browse the repository at this point in the history
…esponding public setters

Some of our Java API requests have public setters but their corresponding getters are package private only. This commit makes those getters public as well.

Closes #9273
  • Loading branch information
javanna committed Jan 13, 2015
1 parent d583080 commit 4bdc89f
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 31 deletions.
Expand Up @@ -58,11 +58,11 @@ public ActionRequestValidationException validate() {
return validationException;
}

Settings transientSettings() {
public Settings transientSettings() {
return transientSettings;
}

Settings persistentSettings() {
public Settings persistentSettings() {
return persistentSettings;
}

Expand Down
Expand Up @@ -24,7 +24,6 @@
import org.elasticsearch.ElasticsearchGenerationException;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
Expand Down Expand Up @@ -131,7 +130,7 @@ public IndicesOptions indicesOptions() {
/**
* The index name to create.
*/
String index() {
public String index() {
return index;
}

Expand All @@ -143,14 +142,14 @@ public CreateIndexRequest index(String index) {
/**
* The settings to create the index with.
*/
Settings settings() {
public Settings settings() {
return settings;
}

/**
* The cause for this index creation.
*/
String cause() {
public String cause() {
return cause;
}

Expand Down Expand Up @@ -424,11 +423,11 @@ public CreateIndexRequest source(Map<String, Object> source) {
return this;
}

Map<String, String> mappings() {
public Map<String, String> mappings() {
return this.mappings;
}

Set<Alias> aliases() {
public Set<Alias> aliases() {
return this.aliases;
}

Expand All @@ -440,7 +439,7 @@ public CreateIndexRequest custom(IndexMetaData.Custom custom) {
return this;
}

Map<String, IndexMetaData.Custom> customs() {
public Map<String, IndexMetaData.Custom> customs() {
return this.customs;
}

Expand Down
Expand Up @@ -21,7 +21,6 @@
import org.elasticsearch.ElasticsearchGenerationException;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.admin.indices.alias.Alias;
Expand Down Expand Up @@ -179,7 +178,7 @@ public PutIndexTemplateRequest settings(Map<String, Object> source) {
return this;
}

Settings settings() {
public Settings settings() {
return this.settings;
}

Expand Down Expand Up @@ -250,7 +249,7 @@ public PutIndexTemplateRequest mapping(String type, Object... source) {
return this;
}

Map<String, String> mappings() {
public Map<String, String> mappings() {
return this.mappings;
}

Expand Down Expand Up @@ -352,11 +351,11 @@ public PutIndexTemplateRequest custom(IndexMetaData.Custom custom) {
return this;
}

Map<String, IndexMetaData.Custom> customs() {
public Map<String, IndexMetaData.Custom> customs() {
return this.customs;
}

Set<Alias> aliases() {
public Set<Alias> aliases() {
return this.aliases;
}

Expand Down
Expand Up @@ -85,7 +85,7 @@ protected void beforeStart() {
/**
* The source to execute.
*/
BytesReference source() {
public BytesReference source() {
return source;
}

Expand Down
Expand Up @@ -87,7 +87,7 @@ private ActionRequestValidationException checkForEmptyString(ActionRequestValida
* The name to delete.
*/
@Nullable
String[] names() {
public String[] names() {
return names;
}

Expand Down
Expand Up @@ -64,7 +64,7 @@ public PutWarmerRequest name(String name) {
return this;
}

String name() {
public String name() {
return this.name;
}

Expand All @@ -84,7 +84,7 @@ public PutWarmerRequest searchRequest(SearchRequestBuilder searchRequest) {
return this;
}

SearchRequest searchRequest() {
public SearchRequest searchRequest() {
return this.searchRequest;
}

Expand Down
Expand Up @@ -21,7 +21,6 @@

import org.elasticsearch.ElasticsearchGenerationException;
import org.elasticsearch.ElasticsearchIllegalArgumentException;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.QuerySourceBuilder;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
Expand All @@ -36,12 +35,12 @@
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentHelper;

import static org.elasticsearch.search.internal.SearchContext.DEFAULT_TERMINATE_AFTER;

import java.io.IOException;
import java.util.Arrays;
import java.util.Map;

import static org.elasticsearch.search.internal.SearchContext.DEFAULT_TERMINATE_AFTER;

/**
* A request to count the number of documents matching a specific query. Best created with
* {@link org.elasticsearch.client.Requests#countRequest(String...)}.
Expand Down Expand Up @@ -101,7 +100,7 @@ protected void beforeStart() {
/**
* The minimum score of the documents to include in the count.
*/
float minScore() {
public float minScore() {
return minScore;
}

Expand All @@ -117,7 +116,7 @@ public CountRequest minScore(float minScore) {
/**
* The source to execute.
*/
BytesReference source() {
public BytesReference source() {
return source;
}

Expand Down
Expand Up @@ -93,7 +93,7 @@ public ActionRequestValidationException validate() {
/**
* The source to execute.
*/
BytesReference source() {
public BytesReference source() {
if (sourceUnsafe) {
source = source.copyBytesArray();
}
Expand Down Expand Up @@ -164,7 +164,7 @@ public DeleteByQueryRequest source(BytesReference source, boolean unsafe) {
/**
* The types of documents the query will run against. Defaults to all types.
*/
String[] types() {
public String[] types() {
return this.types;
}

Expand Down
Expand Up @@ -85,7 +85,7 @@ protected void beforeStart() {
/**
* The minimum score of the documents to include in the count.
*/
float minScore() {
public float minScore() {
return minScore;
}

Expand Down Expand Up @@ -136,7 +136,7 @@ public String preference() {
/**
* The source to execute.
*/
BytesReference source() {
public BytesReference source() {
return source;
}

Expand Down
Expand Up @@ -19,9 +19,6 @@

package org.elasticsearch.action.suggest;

import java.io.IOException;
import java.util.Arrays;

import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.client.Requests;
Expand All @@ -34,6 +31,9 @@
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.search.suggest.SuggestBuilder;

import java.io.IOException;
import java.util.Arrays;

/**
* A request to get suggestions for corrections of phrases. Best created with
* {@link org.elasticsearch.client.Requests#suggestRequest(String...)}.
Expand Down Expand Up @@ -86,7 +86,7 @@ protected void beforeStart() {
/**
* The Phrase to get correction suggestions for
*/
BytesReference suggest() {
public BytesReference suggest() {
return suggestSource;
}

Expand Down

0 comments on commit 4bdc89f

Please sign in to comment.