DATAKV-101 - Favor Iterable over Collection types for KeyValueOperations.

Change return types for Adapter and Operations from Collection types to Iterable. Added count(keyspace) to KeyValueAdapter.

Original pull request: #8.
This commit is contained in:
Christoph Strobl
2015-05-08 09:30:31 +02:00
committed by Thomas Darimont
parent 16dc4b5e7d
commit 952a901164
10 changed files with 198 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -104,6 +104,15 @@ public class MapKeyValueAdapter extends AbstractKeyValueAdapter {
return get(id, keyspace) != null;
}
/* (non-Javadoc)
* @see org.springframework.data.keyvalue.core.KeyValueAdapter#count(java.io.Serializable)
*/
@Override
public long count(Serializable keyspace) {
return getKeySpaceMap(keyspace).size();
}
/*
* (non-Javadoc)
* @see org.springframework.data.keyvalue.core.KeyValueAdapter#get(java.io.Serializable, java.io.Serializable)