Why do suppliers only support no-arg constructors?
If the default constructor is present, I can do this:
create(Foo::new)
But if th
If you have a constructor for new Klass(ConstructorObject) then you can use Function like this:
new Klass(ConstructorObject)
Function
interface Interface { static Klass createKlass(Function, Klass> func, Map input) { return func.apply(input); } } class Klass { private Integer integer; Klass(Map map) { this.integer = map.get("integer"); } public static void main(String[] args) { Map input = new HashMap<>(); input.put("integer", 1); Klass klazz = Interface.createKlass(Klass::new, input); System.out.println(klazz.integer); } }