DATAKV-322 - Polishing.

Add since tags. Make fields final where possible.

Original pull request: #48.
This commit is contained in:
Mark Paluch
2020-09-30 14:17:20 +02:00
parent e90373f892
commit b56a7e5b7b
2 changed files with 16 additions and 7 deletions

View File

@@ -30,12 +30,14 @@ public class KeyValueQuery<T> {
private Sort sort = Sort.unsorted();
private long offset = -1;
private int rows = -1;
private @Nullable T criteria;
private final @Nullable T criteria;
/**
* Creates new instance of {@link KeyValueQuery}.
*/
public KeyValueQuery() {}
public KeyValueQuery() {
this((T) null);
}
/**
* Creates new instance of {@link KeyValueQuery} with given criteria.
@@ -51,6 +53,7 @@ public class KeyValueQuery<T> {
*
* @param criteria can be {@literal null}.
* @param sort must not be {@literal null}.
* @since 2.4
*/
public KeyValueQuery(@Nullable T criteria, Sort sort) {
this.criteria = criteria;
@@ -63,6 +66,7 @@ public class KeyValueQuery<T> {
* @param sort must not be {@literal null}.
*/
public KeyValueQuery(Sort sort) {
this();
setSort(sort);
}

View File

@@ -52,7 +52,8 @@ public class MapKeyValueAdapter extends AbstractKeyValueAdapter {
/**
* Create new {@link MapKeyValueAdapter} using the given query engine.
*
* @param engine the query engine
* @param engine the query engine.
* @since 2.4
*/
public MapKeyValueAdapter(QueryEngine<? extends KeyValueAdapter, ?, ?> engine) {
this(ConcurrentHashMap.class, engine);
@@ -72,7 +73,8 @@ public class MapKeyValueAdapter extends AbstractKeyValueAdapter {
* Creates a new {@link MapKeyValueAdapter} using the given {@link Map} as backing store and query engine.
*
* @param mapType must not be {@literal null}.
* @param engine the query engine
* @param engine the query engine.
* @since 2.4
*/
@SuppressWarnings("rawtypes")
public MapKeyValueAdapter(Class<? extends Map> mapType, QueryEngine<? extends KeyValueAdapter, ?, ?> engine) {
@@ -93,7 +95,8 @@ public class MapKeyValueAdapter extends AbstractKeyValueAdapter {
* Create new instance of {@link MapKeyValueAdapter} using given dataStore for persistence and query engine.
*
* @param store must not be {@literal null}.
* @param engine the query engine
* @param engine the query engine.
* @since 2.4
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public MapKeyValueAdapter(Map<String, Map<Object, Object>> store, QueryEngine<? extends KeyValueAdapter, ?, ?> engine) {
@@ -101,14 +104,16 @@ public class MapKeyValueAdapter extends AbstractKeyValueAdapter {
}
/**
* Creates a new {@link MapKeyValueAdapter} with the given store and type to be used when creating key spaces and query engine.
* Creates a new {@link MapKeyValueAdapter} with the given store and type to be used when creating key spaces and
* query engine.
*
* @param store must not be {@literal null}.
* @param keySpaceMapType must not be {@literal null}.
* @param engine the query engine
* @param engine the query engine.
*/
@SuppressWarnings("rawtypes")
private MapKeyValueAdapter(Map<String, Map<Object, Object>> store, Class<? extends Map> keySpaceMapType, QueryEngine<? extends KeyValueAdapter, ?, ?> engine) {
super(engine);
Assert.notNull(store, "Store must not be null.");