Моя проблема в том, что существует общий класс под названием
Код: Выделить всё
TypedProducer
Код: Выделить всё
Integer
Код: Выделить всё
String
Код: Выделить всё
Object
How can I instantiate
Код: Выделить всё
TypedProducer
Код: Выделить всё
SourceTypedClassProvider
Код: Выделить всё
.class
Код: Выделить всё
public class SourceTypedClassProvider {
public static TypedProducer instantiateTypedProducer(
Class keyType, Class valueType) {
//should return instance of TypedProducer
}
}
Код: Выделить всё
TypeToken
EDIT:
To be honest
Код: Выделить всё
TypedProducer
Код: Выделить всё
Map
Код: Выделить всё
public class TypedProducer {
ExternalApiProducer externalApiProducer;
public TypedProducer() {
externalApiProducer = new ExternalApiProducer();
}
public Map produceRecords() {
//some code that calls externalApiProducer to produce records
}
}
Источник: https://stackoverflow.com/questions/781 ... -parameter