DATAKV-310 - Polishing.

Use consistent punctuation in asserts.
Update link to code of conduct.

Original Pull Request: #50
This commit is contained in:
Christoph Strobl
2020-07-15 07:08:41 +02:00
parent 72636fb4fc
commit 5c328f17c6
6 changed files with 22 additions and 22 deletions

View File

@@ -12,7 +12,7 @@ This module provides infrastructure components to build repository abstractions
== Code of Conduct
This project is governed by the https://github.com/spring-projects/.github/CODE_OF_CONDUCT.adoc[Spring Code of Conduct]. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
This project is governed by the https://github.com/spring-projects/.github/blob/master/CODE_OF_CONDUCT.md[Spring Code of Conduct]. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
== Getting Started

View File

@@ -95,7 +95,7 @@ public class KeyValueTemplate implements KeyValueOperations, ApplicationEventPub
*/
public void setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator) {
Assert.notNull(exceptionTranslator, "ExceptionTranslator must not be null.");
Assert.notNull(exceptionTranslator, "ExceptionTranslator must not be null!");
this.exceptionTranslator = exceptionTranslator;
}

View File

@@ -54,8 +54,8 @@ abstract class KeyValueQuerydslUtils {
*/
static OrderSpecifier<?>[] toOrderSpecifier(Sort sort, PathBuilder<?> builder) {
Assert.notNull(sort, "Sort must not be null.");
Assert.notNull(builder, "Builder must not be null.");
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(builder, "Builder must not be null!");
List<OrderSpecifier<?>> specifiers = null;

View File

@@ -96,7 +96,7 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public Optional<T> findOne(Predicate predicate) {
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(predicate, "Predicate must not be null!");
try {
return Optional.ofNullable(prepareQuery(predicate).fetchOne());
@@ -112,7 +112,7 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public Iterable<T> findAll(Predicate predicate) {
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(predicate, "Predicate must not be null!");
return prepareQuery(predicate).fetchResults().getResults();
}
@@ -124,8 +124,8 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public Iterable<T> findAll(Predicate predicate, OrderSpecifier<?>... orders) {
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(orders, "OrderSpecifiers must not be null");
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(orders, "OrderSpecifiers must not be null!");
AbstractCollQuery<T, ?> query = prepareQuery(predicate);
query.orderBy(orders);
@@ -140,8 +140,8 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public Iterable<T> findAll(Predicate predicate, Sort sort) {
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(sort, "Sort must not be null");
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(sort, "Sort must not be null!");
return findAll(predicate, toOrderSpecifier(sort, builder));
}
@@ -153,8 +153,8 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public Page<T> findAll(Predicate predicate, Pageable pageable) {
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(pageable, "Pageable must not be null");
Assert.notNull(predicate, "Predicate must not be null!");
Assert.notNull(pageable, "Pageable must not be null!");
AbstractCollQuery<T, ?> query = prepareQuery(predicate);
@@ -178,7 +178,7 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public Iterable<T> findAll(OrderSpecifier<?>... orders) {
Assert.notNull(orders, "OrderSpecifiers must not be null");
Assert.notNull(orders, "OrderSpecifiers must not be null!");
if (ObjectUtils.isEmpty(orders)) {
return findAll();
@@ -197,7 +197,7 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public long count(Predicate predicate) {
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(predicate, "Predicate must not be null!");
return prepareQuery(predicate).fetchCount();
}
@@ -209,7 +209,7 @@ public class QuerydslKeyValueRepository<T, ID> extends SimpleKeyValueRepository<
@Override
public boolean exists(Predicate predicate) {
Assert.notNull(predicate, "Predicate must not be null");
Assert.notNull(predicate, "Predicate must not be null!");
return count(predicate) > 0;
}

View File

@@ -114,7 +114,7 @@ public class SimpleKeyValueRepository<T, ID> implements KeyValueRepository<T, ID
@Override
public <S extends T> Iterable<S> saveAll(Iterable<S> entities) {
Assert.notNull(entities, "The given Iterable of entities must not be null");
Assert.notNull(entities, "The given Iterable of entities must not be null!");
List<S> saved = new ArrayList<>();
@@ -132,7 +132,7 @@ public class SimpleKeyValueRepository<T, ID> implements KeyValueRepository<T, ID
@Override
public Optional<T> findById(ID id) {
Assert.notNull(id, "The given id must not be null");
Assert.notNull(id, "The given id must not be null!");
return operations.findById(id, entityInformation.getJavaType());
}
@@ -162,7 +162,7 @@ public class SimpleKeyValueRepository<T, ID> implements KeyValueRepository<T, ID
@Override
public Iterable<T> findAllById(Iterable<ID> ids) {
Assert.notNull(ids, "The given Iterable of id's must not be null");
Assert.notNull(ids, "The given Iterable of id's must not be null!");
List<T> result = new ArrayList<>();
@@ -187,7 +187,7 @@ public class SimpleKeyValueRepository<T, ID> implements KeyValueRepository<T, ID
@Override
public void deleteById(ID id) {
Assert.notNull(id, "The given id must not be null");
Assert.notNull(id, "The given id must not be null!");
operations.delete(id, entityInformation.getJavaType());
}
@@ -199,7 +199,7 @@ public class SimpleKeyValueRepository<T, ID> implements KeyValueRepository<T, ID
@Override
public void delete(T entity) {
Assert.notNull(entity, "The given entity must not be null");
Assert.notNull(entity, "The given entity must not be null!");
deleteById(entityInformation.getRequiredId(entity));
}
@@ -211,7 +211,7 @@ public class SimpleKeyValueRepository<T, ID> implements KeyValueRepository<T, ID
@Override
public void deleteAll(Iterable<? extends T> entities) {
Assert.notNull(entities, "The given Iterable of entities must not be null");
Assert.notNull(entities, "The given Iterable of entities must not be null!");
entities.forEach(this::delete);
}

View File

@@ -188,7 +188,7 @@ public class MapKeyValueAdapter extends AbstractKeyValueAdapter {
*/
protected Map<Object, Object> getKeySpaceMap(String keyspace) {
Assert.notNull(keyspace, "Collection must not be null for lookup.");
Assert.notNull(keyspace, "Collection must not be null for lookup!");
return store.computeIfAbsent(keyspace, k -> CollectionFactory.createMap(keySpaceMapType, 1000));
}