I need to represent each entry of a Map as type T and I don't know how to do that.
Here is the definition of entryset:
public Set<Map.Entry<K,V>> entrySet()
so I need something like this:
Map<?,?> -> Set<T>
This will compile:
public static <T, E> void Each(Map i, IEacher<T, E> m, Asyncc.IEachCallback<E> f) {
NeoEach.Each(Integer.MAX_VALUE, i.<T>entrySet(), m, f);
}
but I get a warning:
Unchecked assignment: 'java.util.Set' to 'java.lang.Iterable'. Reason: 'i' has raw type, so result of entrySet is erased
but what's weird is that this won't compile:
public static <T, E> void Each(Map<Object,Object> i, IEacher<T, E> m, Asyncc.IEachCallback<E> f) {
NeoEach.Each(Integer.MAX_VALUE, i.<T>entrySet(), m, f);
}
using Map i
compiles, but Map<Object,Object> i
won't it says:
expected:
i:java.lang.Iterable<T>
actual:
i.<T>entrySet() (java...java.lang.Object,java.lang.Object>>)