DATAMONGO-1421 - Polishing.

Remove trailing whitespaces. Construct exception message with String.format(…).

Original pull request: #448.
This commit is contained in:
Mark Paluch
2017-03-08 08:43:51 +01:00
parent 9c035a190a
commit 560a20fe38

View File

@@ -59,7 +59,7 @@ public class Query {
/**
* Static factory method to create a {@link Query} using the provided {@link CriteriaDefinition}.
*
*
* @param criteriaDefinition must not be {@literal null}.
* @return
* @since 1.6
@@ -72,7 +72,7 @@ public class Query {
/**
* Creates a new {@link Query} using the given {@link CriteriaDefinition}.
*
*
* @param criteriaDefinition must not be {@literal null}.
* @since 1.6
*/
@@ -82,7 +82,7 @@ public class Query {
/**
* Adds the given {@link CriteriaDefinition} to the current {@link Query}.
*
*
* @param criteriaDefinition must not be {@literal null}.
* @return
* @since 1.6
@@ -96,8 +96,8 @@ public class Query {
this.criteria.put(key, criteriaDefinition);
} else {
throw new InvalidMongoDbApiUsageException(
"Due to limitations of the com.mongodb.BasicDBObject, " + "you can't add a second '" + key + "' criteria. "
+ "Query already contains '" + serializeToJsonSafely(existing.getCriteriaObject()) + "'.");
String.format("Due to limitations of the com.mongodb.BasicDBObject, you can't add a second '%s' criteria. "
+ "Query already contains '%s'", key, serializeToJsonSafely(existing.getCriteriaObject())));
}
return this;
@@ -112,7 +112,7 @@ public class Query {
/**
* Set number of documents to skip before returning results.
*
*
* @param skip
* @return
*/
@@ -123,7 +123,7 @@ public class Query {
/**
* Limit the number of returned documents to {@code limit}.
*
*
* @param limit
* @return
*/
@@ -134,7 +134,7 @@ public class Query {
/**
* Configures the query to use the given hint when being executed.
*
*
* @param name must not be {@literal null} or empty.
* @return
*/
@@ -147,7 +147,7 @@ public class Query {
/**
* Sets the given pagination information on the {@link Query} instance. Will transparently set {@code skip} and
* {@code limit} as well as applying the {@link Sort} instance defined with the {@link Pageable}.
*
*
* @param pageable
* @return
*/
@@ -165,7 +165,7 @@ public class Query {
/**
* Adds a {@link Sort} to the {@link Query} instance.
*
*
* @param sort
* @return
*/
@@ -200,7 +200,7 @@ public class Query {
/**
* Restricts the query to only return documents instances that are exactly of the given types.
*
*
* @param type may not be {@literal null}
* @param additionalTypes may not be {@literal null}
* @return
@@ -254,7 +254,7 @@ public class Query {
/**
* Get the number of documents to skip.
*
*
* @return
*/
public int getSkip() {
@@ -263,7 +263,7 @@ public class Query {
/**
* Get the maximum number of documents to be return.
*
*
* @return
*/
public int getLimit() {
@@ -433,7 +433,7 @@ public class Query {
/**
* Tests whether the settings of the given {@link Query} are equal to this query.
*
*
* @param that
* @return
*/
@@ -450,7 +450,7 @@ public class Query {
return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual;
}
/*
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@@ -472,7 +472,7 @@ public class Query {
/**
* Returns whether the given key is the one used to hold the type restriction information.
*
*
* @deprecated don't call this method as the restricted type handling will undergo some significant changes going
* forward.
* @param key