Commits

Anonymous committed ab989b1

a little more abstraction in this barrier: Java client signature now says List instead of ArrayList

  • Participants
  • Parent commits 08d6791

Comments (0)

Files changed (2)

client_lib/java/src/com/basho/riak/JiakClient.java

 	 *            <code>bucket,tag-spec,accumulateFlag</code> The
 	 *            <code>tag-spec "_"</code> matches all tags.
 	 *            <code>accumulateFlag</code> is either the String "1" or "0".
-	 * @return An <code>ArrayList</code> of <code>ArrayLists</code>, where each
+	 * @return A <code>List</code> of <code>Lists</code>, where each
 	 *         sub-list corresponds to a <code>walkSpec</code> element that had
 	 *         <code>accumulateFlag</code> equal to 1.
 	 * @throws IOException
 	 *             If the Riak server returns an error or unexpected response
 	 *             code.
 	 */
-	public ArrayList<ArrayList<JiakObject>> walk(final String bucket,
+	public List<? extends List<JiakObject>> walk(final String bucket,
 			final String key, final String walkSpec) throws IOException,
 			JSONException, JiakException {
 		final ArrayList<ArrayList<JiakObject>> results = new ArrayList<ArrayList<JiakObject>>();
 		return results;
 	}
 
-	public ArrayList<ArrayList<JiakObject>> walk(final String bucket,
+	public List<? extends List<JiakObject>> walk(final String bucket,
 			final String key, final JiakWalkSpec walkSpec) throws IOException,
 			JSONException, JiakException {
 		return walk(bucket, key, walkSpec.toString());

client_lib/java/src/com/basho/riak/JiakTest.java

 		client.store(jLeaf1);
 		client.store(jLeaf2);
 		client.store(jLeaf3);
-		ArrayList<ArrayList<JiakObject>> res = client.walk("jiak_example", "jroot", "jiak_example,tag_one,1");
-		for (ArrayList<JiakObject> i : res) {
+		List<? extends List<JiakObject>> res = client.walk("jiak_example", "jroot", "jiak_example,tag_one,1");
+		for (List<JiakObject> i : res) {
 			for (JiakObject j: i) {
 				assert(j.get("foo").equals("in results"));
 			}