Remove @Required annotation
The @Required annotation is used for documentation purposes only anyway.
This commit is contained in:
parent
abcf8fc0f7
commit
a03013ea25
|
@ -23,7 +23,6 @@ import org.elasticsearch.ElasticSearchGenerationException;
|
||||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
||||||
import org.elasticsearch.action.ActionRequestValidationException;
|
import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequest;
|
import org.elasticsearch.action.support.master.MasterNodeOperationRequest;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -111,7 +110,6 @@ public class PutMappingRequest extends MasterNodeOperationRequest<PutMappingRequ
|
||||||
/**
|
/**
|
||||||
* The type of the mappings.
|
* The type of the mappings.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public PutMappingRequest type(String type) {
|
public PutMappingRequest type(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
|
@ -166,7 +164,6 @@ public class PutMappingRequest extends MasterNodeOperationRequest<PutMappingRequ
|
||||||
/**
|
/**
|
||||||
* The mapping source definition.
|
* The mapping source definition.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public PutMappingRequest source(XContentBuilder mappingBuilder) {
|
public PutMappingRequest source(XContentBuilder mappingBuilder) {
|
||||||
try {
|
try {
|
||||||
return source(mappingBuilder.string());
|
return source(mappingBuilder.string());
|
||||||
|
@ -178,7 +175,6 @@ public class PutMappingRequest extends MasterNodeOperationRequest<PutMappingRequ
|
||||||
/**
|
/**
|
||||||
* The mapping source definition.
|
* The mapping source definition.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public PutMappingRequest source(Map mappingSource) {
|
public PutMappingRequest source(Map mappingSource) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
|
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
|
||||||
|
@ -192,7 +188,6 @@ public class PutMappingRequest extends MasterNodeOperationRequest<PutMappingRequ
|
||||||
/**
|
/**
|
||||||
* The mapping source definition.
|
* The mapping source definition.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public PutMappingRequest source(String mappingSource) {
|
public PutMappingRequest source(String mappingSource) {
|
||||||
this.source = mappingSource;
|
this.source = mappingSource;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
|
||||||
import org.elasticsearch.client.IndicesAdminClient;
|
import org.elasticsearch.client.IndicesAdminClient;
|
||||||
import org.elasticsearch.client.internal.InternalIndicesAdminClient;
|
import org.elasticsearch.client.internal.InternalIndicesAdminClient;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
|
||||||
|
@ -46,7 +45,6 @@ public class PutMappingRequestBuilder extends MasterNodeOperationRequestBuilder<
|
||||||
/**
|
/**
|
||||||
* The type of the mappings.
|
* The type of the mappings.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public PutMappingRequestBuilder setType(String type) {
|
public PutMappingRequestBuilder setType(String type) {
|
||||||
request.type(type);
|
request.type(type);
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ElasticSearchGenerationException;
|
||||||
import org.elasticsearch.action.ActionRequestValidationException;
|
import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
|
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
|
||||||
import org.elasticsearch.client.Requests;
|
import org.elasticsearch.client.Requests;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
|
@ -95,7 +94,6 @@ public class ValidateQueryRequest extends BroadcastOperationRequest<ValidateQuer
|
||||||
*
|
*
|
||||||
* @see org.elasticsearch.index.query.QueryBuilders
|
* @see org.elasticsearch.index.query.QueryBuilders
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public ValidateQueryRequest query(QueryBuilder queryBuilder) {
|
public ValidateQueryRequest query(QueryBuilder queryBuilder) {
|
||||||
this.querySource = queryBuilder.buildAsBytes();
|
this.querySource = queryBuilder.buildAsBytes();
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -105,7 +103,6 @@ public class ValidateQueryRequest extends BroadcastOperationRequest<ValidateQuer
|
||||||
/**
|
/**
|
||||||
* The query source to execute in the form of a map.
|
* The query source to execute in the form of a map.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public ValidateQueryRequest query(Map querySource) {
|
public ValidateQueryRequest query(Map querySource) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -116,7 +113,6 @@ public class ValidateQueryRequest extends BroadcastOperationRequest<ValidateQuer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public ValidateQueryRequest query(XContentBuilder builder) {
|
public ValidateQueryRequest query(XContentBuilder builder) {
|
||||||
this.querySource = builder.bytes();
|
this.querySource = builder.bytes();
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -127,7 +123,6 @@ public class ValidateQueryRequest extends BroadcastOperationRequest<ValidateQuer
|
||||||
* The query source to validate. It is preferable to use either {@link #query(byte[])}
|
* The query source to validate. It is preferable to use either {@link #query(byte[])}
|
||||||
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
|
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public ValidateQueryRequest query(String querySource) {
|
public ValidateQueryRequest query(String querySource) {
|
||||||
this.querySource = new BytesArray(querySource);
|
this.querySource = new BytesArray(querySource);
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -137,7 +132,6 @@ public class ValidateQueryRequest extends BroadcastOperationRequest<ValidateQuer
|
||||||
/**
|
/**
|
||||||
* The query source to validate.
|
* The query source to validate.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public ValidateQueryRequest query(byte[] querySource) {
|
public ValidateQueryRequest query(byte[] querySource) {
|
||||||
return query(querySource, 0, querySource.length, false);
|
return query(querySource, 0, querySource.length, false);
|
||||||
}
|
}
|
||||||
|
@ -145,7 +139,6 @@ public class ValidateQueryRequest extends BroadcastOperationRequest<ValidateQuer
|
||||||
/**
|
/**
|
||||||
* The query source to validate.
|
* The query source to validate.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public ValidateQueryRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
|
public ValidateQueryRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
|
||||||
return query(new BytesArray(querySource, offset, length), unsafe);
|
return query(new BytesArray(querySource, offset, length), unsafe);
|
||||||
}
|
}
|
||||||
|
@ -153,7 +146,6 @@ public class ValidateQueryRequest extends BroadcastOperationRequest<ValidateQuer
|
||||||
/**
|
/**
|
||||||
* The query source to validate.
|
* The query source to validate.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public ValidateQueryRequest query(BytesReference querySource, boolean unsafe) {
|
public ValidateQueryRequest query(BytesReference querySource, boolean unsafe) {
|
||||||
this.querySource = querySource;
|
this.querySource = querySource;
|
||||||
this.querySourceUnsafe = unsafe;
|
this.querySourceUnsafe = unsafe;
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
|
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
|
||||||
import org.elasticsearch.client.Requests;
|
import org.elasticsearch.client.Requests;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
|
@ -125,7 +124,6 @@ public class CountRequest extends BroadcastOperationRequest<CountRequest> {
|
||||||
*
|
*
|
||||||
* @see org.elasticsearch.index.query.QueryBuilders
|
* @see org.elasticsearch.index.query.QueryBuilders
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public CountRequest query(QueryBuilder queryBuilder) {
|
public CountRequest query(QueryBuilder queryBuilder) {
|
||||||
this.querySource = queryBuilder.buildAsBytes();
|
this.querySource = queryBuilder.buildAsBytes();
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -135,7 +133,6 @@ public class CountRequest extends BroadcastOperationRequest<CountRequest> {
|
||||||
/**
|
/**
|
||||||
* The query source to execute in the form of a map.
|
* The query source to execute in the form of a map.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public CountRequest query(Map querySource) {
|
public CountRequest query(Map querySource) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -146,7 +143,6 @@ public class CountRequest extends BroadcastOperationRequest<CountRequest> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public CountRequest query(XContentBuilder builder) {
|
public CountRequest query(XContentBuilder builder) {
|
||||||
this.querySource = builder.bytes();
|
this.querySource = builder.bytes();
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -157,7 +153,6 @@ public class CountRequest extends BroadcastOperationRequest<CountRequest> {
|
||||||
* The query source to execute. It is preferable to use either {@link #query(byte[])}
|
* The query source to execute. It is preferable to use either {@link #query(byte[])}
|
||||||
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
|
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public CountRequest query(String querySource) {
|
public CountRequest query(String querySource) {
|
||||||
this.querySource = new BytesArray(querySource);
|
this.querySource = new BytesArray(querySource);
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -167,7 +162,6 @@ public class CountRequest extends BroadcastOperationRequest<CountRequest> {
|
||||||
/**
|
/**
|
||||||
* The query source to execute.
|
* The query source to execute.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public CountRequest query(byte[] querySource) {
|
public CountRequest query(byte[] querySource) {
|
||||||
return query(querySource, 0, querySource.length, false);
|
return query(querySource, 0, querySource.length, false);
|
||||||
}
|
}
|
||||||
|
@ -175,12 +169,10 @@ public class CountRequest extends BroadcastOperationRequest<CountRequest> {
|
||||||
/**
|
/**
|
||||||
* The query source to execute.
|
* The query source to execute.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public CountRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
|
public CountRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
|
||||||
return query(new BytesArray(querySource, offset, length), unsafe);
|
return query(new BytesArray(querySource, offset, length), unsafe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public CountRequest query(BytesReference querySource, boolean unsafe) {
|
public CountRequest query(BytesReference querySource, boolean unsafe) {
|
||||||
this.querySource = querySource;
|
this.querySource = querySource;
|
||||||
this.querySourceUnsafe = unsafe;
|
this.querySourceUnsafe = unsafe;
|
||||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.action.delete;
|
||||||
import org.elasticsearch.action.ActionRequestValidationException;
|
import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.support.replication.ShardReplicationOperationRequest;
|
import org.elasticsearch.action.support.replication.ShardReplicationOperationRequest;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.index.VersionType;
|
import org.elasticsearch.index.VersionType;
|
||||||
|
@ -108,7 +107,6 @@ public class DeleteRequest extends ShardReplicationOperationRequest<DeleteReques
|
||||||
/**
|
/**
|
||||||
* Sets the type of the document to delete.
|
* Sets the type of the document to delete.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public DeleteRequest type(String type) {
|
public DeleteRequest type(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
|
@ -124,7 +122,6 @@ public class DeleteRequest extends ShardReplicationOperationRequest<DeleteReques
|
||||||
/**
|
/**
|
||||||
* Sets the id of the document to delete.
|
* Sets the id of the document to delete.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public DeleteRequest id(String id) {
|
public DeleteRequest id(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.support.replication.IndicesReplicationOperationRequest;
|
import org.elasticsearch.action.support.replication.IndicesReplicationOperationRequest;
|
||||||
import org.elasticsearch.client.Requests;
|
import org.elasticsearch.client.Requests;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
|
@ -100,7 +99,6 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest<Del
|
||||||
*
|
*
|
||||||
* @see org.elasticsearch.index.query.QueryBuilders
|
* @see org.elasticsearch.index.query.QueryBuilders
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public DeleteByQueryRequest query(QueryBuilder queryBuilder) {
|
public DeleteByQueryRequest query(QueryBuilder queryBuilder) {
|
||||||
this.querySource = queryBuilder.buildAsBytes();
|
this.querySource = queryBuilder.buildAsBytes();
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -111,7 +109,6 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest<Del
|
||||||
* The query source to execute. It is preferable to use either {@link #query(byte[])}
|
* The query source to execute. It is preferable to use either {@link #query(byte[])}
|
||||||
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
|
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public DeleteByQueryRequest query(String querySource) {
|
public DeleteByQueryRequest query(String querySource) {
|
||||||
this.querySource = new BytesArray(querySource.getBytes(Charsets.UTF_8));
|
this.querySource = new BytesArray(querySource.getBytes(Charsets.UTF_8));
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -121,7 +118,6 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest<Del
|
||||||
/**
|
/**
|
||||||
* The query source to execute in the form of a map.
|
* The query source to execute in the form of a map.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public DeleteByQueryRequest query(Map querySource) {
|
public DeleteByQueryRequest query(Map querySource) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -132,7 +128,6 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest<Del
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public DeleteByQueryRequest query(XContentBuilder builder) {
|
public DeleteByQueryRequest query(XContentBuilder builder) {
|
||||||
this.querySource = builder.bytes();
|
this.querySource = builder.bytes();
|
||||||
this.querySourceUnsafe = false;
|
this.querySourceUnsafe = false;
|
||||||
|
@ -142,7 +137,6 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest<Del
|
||||||
/**
|
/**
|
||||||
* The query source to execute.
|
* The query source to execute.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public DeleteByQueryRequest query(byte[] querySource) {
|
public DeleteByQueryRequest query(byte[] querySource) {
|
||||||
return query(querySource, 0, querySource.length, false);
|
return query(querySource, 0, querySource.length, false);
|
||||||
}
|
}
|
||||||
|
@ -150,7 +144,6 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest<Del
|
||||||
/**
|
/**
|
||||||
* The query source to execute.
|
* The query source to execute.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public DeleteByQueryRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
|
public DeleteByQueryRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
|
||||||
this.querySource = new BytesArray(querySource, offset, length);
|
this.querySource = new BytesArray(querySource, offset, length);
|
||||||
this.querySourceUnsafe = unsafe;
|
this.querySourceUnsafe = unsafe;
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.ValidateActions;
|
import org.elasticsearch.action.ValidateActions;
|
||||||
import org.elasticsearch.action.support.single.shard.SingleShardOperationRequest;
|
import org.elasticsearch.action.support.single.shard.SingleShardOperationRequest;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.lucene.uid.Versions;
|
import org.elasticsearch.common.lucene.uid.Versions;
|
||||||
|
@ -113,7 +112,6 @@ public class GetRequest extends SingleShardOperationRequest<GetRequest> {
|
||||||
/**
|
/**
|
||||||
* Sets the id of the document to fetch.
|
* Sets the id of the document to fetch.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public GetRequest id(String id) {
|
public GetRequest id(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.elasticsearch.client.Requests;
|
||||||
import org.elasticsearch.cluster.metadata.MappingMetaData;
|
import org.elasticsearch.cluster.metadata.MappingMetaData;
|
||||||
import org.elasticsearch.cluster.metadata.MetaData;
|
import org.elasticsearch.cluster.metadata.MetaData;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
|
@ -208,7 +207,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
/**
|
/**
|
||||||
* Sets the type of the indexed document.
|
* Sets the type of the indexed document.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public IndexRequest type(String type) {
|
public IndexRequest type(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
|
@ -322,7 +320,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
*
|
*
|
||||||
* @param source The map to index
|
* @param source The map to index
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public IndexRequest source(Map source) throws ElasticSearchGenerationException {
|
public IndexRequest source(Map source) throws ElasticSearchGenerationException {
|
||||||
return source(source, contentType);
|
return source(source, contentType);
|
||||||
}
|
}
|
||||||
|
@ -332,7 +329,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
*
|
*
|
||||||
* @param source The map to index
|
* @param source The map to index
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public IndexRequest source(Map source, XContentType contentType) throws ElasticSearchGenerationException {
|
public IndexRequest source(Map source, XContentType contentType) throws ElasticSearchGenerationException {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -349,7 +345,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
* <p>Note, its preferable to either set it using {@link #source(org.elasticsearch.common.xcontent.XContentBuilder)}
|
* <p>Note, its preferable to either set it using {@link #source(org.elasticsearch.common.xcontent.XContentBuilder)}
|
||||||
* or using the {@link #source(byte[])}.
|
* or using the {@link #source(byte[])}.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public IndexRequest source(String source) {
|
public IndexRequest source(String source) {
|
||||||
this.source = new BytesArray(source.getBytes(Charsets.UTF_8));
|
this.source = new BytesArray(source.getBytes(Charsets.UTF_8));
|
||||||
this.sourceUnsafe = false;
|
this.sourceUnsafe = false;
|
||||||
|
@ -359,14 +354,12 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
/**
|
/**
|
||||||
* Sets the content source to index.
|
* Sets the content source to index.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public IndexRequest source(XContentBuilder sourceBuilder) {
|
public IndexRequest source(XContentBuilder sourceBuilder) {
|
||||||
source = sourceBuilder.bytes();
|
source = sourceBuilder.bytes();
|
||||||
sourceUnsafe = false;
|
sourceUnsafe = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public IndexRequest source(String field1, Object value1) {
|
public IndexRequest source(String field1, Object value1) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -377,7 +370,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public IndexRequest source(String field1, Object value1, String field2, Object value2) {
|
public IndexRequest source(String field1, Object value1, String field2, Object value2) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -388,7 +380,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public IndexRequest source(String field1, Object value1, String field2, Object value2, String field3, Object value3) {
|
public IndexRequest source(String field1, Object value1, String field2, Object value2, String field3, Object value3) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -399,7 +390,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public IndexRequest source(String field1, Object value1, String field2, Object value2, String field3, Object value3, String field4, Object value4) {
|
public IndexRequest source(String field1, Object value1, String field2, Object value2, String field3, Object value3, String field4, Object value4) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -410,7 +400,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Required
|
|
||||||
public IndexRequest source(Object... source) {
|
public IndexRequest source(Object... source) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
|
||||||
|
@ -449,7 +438,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
* @param offset The offset in the byte array
|
* @param offset The offset in the byte array
|
||||||
* @param length The length of the data
|
* @param length The length of the data
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public IndexRequest source(byte[] source, int offset, int length) {
|
public IndexRequest source(byte[] source, int offset, int length) {
|
||||||
return source(source, offset, length, false);
|
return source(source, offset, length, false);
|
||||||
}
|
}
|
||||||
|
@ -462,7 +450,6 @@ public class IndexRequest extends ShardReplicationOperationRequest<IndexRequest>
|
||||||
* @param length The length of the data
|
* @param length The length of the data
|
||||||
* @param unsafe Is the byte array safe to be used form a different thread
|
* @param unsafe Is the byte array safe to be used form a different thread
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public IndexRequest source(byte[] source, int offset, int length, boolean unsafe) {
|
public IndexRequest source(byte[] source, int offset, int length, boolean unsafe) {
|
||||||
this.source = new BytesArray(source, offset, length);
|
this.source = new BytesArray(source, offset, length);
|
||||||
this.sourceUnsafe = unsafe;
|
this.sourceUnsafe = unsafe;
|
||||||
|
|
|
@ -27,7 +27,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.ValidateActions;
|
import org.elasticsearch.action.ValidateActions;
|
||||||
import org.elasticsearch.action.search.SearchType;
|
import org.elasticsearch.action.search.SearchType;
|
||||||
import org.elasticsearch.client.Requests;
|
import org.elasticsearch.client.Requests;
|
||||||
import org.elasticsearch.common.Required;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesArray;
|
import org.elasticsearch.common.bytes.BytesArray;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
|
@ -121,7 +120,6 @@ public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> {
|
||||||
/**
|
/**
|
||||||
* The type of document to load from which the "like" query will execute with.
|
* The type of document to load from which the "like" query will execute with.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public MoreLikeThisRequest type(String type) {
|
public MoreLikeThisRequest type(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
|
@ -137,7 +135,6 @@ public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> {
|
||||||
/**
|
/**
|
||||||
* The id of document to load from which the "like" query will execute with.
|
* The id of document to load from which the "like" query will execute with.
|
||||||
*/
|
*/
|
||||||
@Required
|
|
||||||
public MoreLikeThisRequest id(String id) {
|
public MoreLikeThisRequest id(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to ElasticSearch and Shay Banon under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. ElasticSearch licenses this
|
|
||||||
* file to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.common;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The presence of this annotation on a method parameter indicates that
|
|
||||||
* {@code null} is an acceptable value for that parameter. It should not be
|
|
||||||
* used for parameters of primitive types.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Documented
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
|
|
||||||
public @interface Required {
|
|
||||||
}
|
|
Loading…
Reference in New Issue