我试图使用具有像这样的方法签名第三方库:作为方法参数传递迭代?
testMethod(Iterable<HashMap<String,Date>>, String, String)
我怎么能传递一个迭代,以这种方法吗?
我想做一些像下面,但它失败:
HashMap<String,Date> items = new HashMap<String, Date>();
items.put("item1", new Date());
items.put("item2", new Date());
testMethod(items, "more", "data");
@DaveNewton目标方法期待'可迭代>' –
@SotiriosDelimanolis噢,糟糕;在我的脑海中,它只是一个值类型列表。它必须具有传染性。 –
@DaveNewton周日不好的情况下,男人! –