为什么 IntelliJ 告诉这个从对象到字符串的转换是多余的?
public class Utils {
private static Map<Class, Function<Object, ?>> functions = new HashMap<>();
static {
functions.put(String.class, v -> (String) v);
functions.put(Foo.class, v -> {
Foo foo = new Foo();
foo.setA((String) ((Map<String, Object>) v).get("A"));
foo.setB((String) ((Map<String, Object>) v).get("B"));
return foo;
});
}
}