I know I can have a function that takes a Class and returns an instance parametrized with that class like so
public <T> Broker<T> apply(Class<T> clazz){
//code
}
My question is how can my class implement the Function<T,R>
?
Following does not work:
class MyClass implements Function<Class<?>, Broker<?>>
Neither does this, since my class cannot be parametrized to one type, and a single instance will serve different classes
class MyClass<T> implements Function<Class<T>, Broker<T>>