assert value != null;
assert index >= 0;
assert requiresReducer(slot);
ModelFactory f = environment.getModelFactory();
SimpleName className = f.newSimpleName(Naming.getMapClass(index));
ImportBuilder importer = new ImportBuilder(
f,
f.newPackageDeclaration(environment.getEpiloguePackageName(moduleId)),
Strategy.TOP_LEVEL);
importer.resolvePackageMember(className);
List<Expression> arguments = Lists.create();
arguments.add(Models.toLiteral(f, index));
arguments.add(classLiteralOrNull(f, importer, key));
arguments.add(classLiteralOrNull(f, importer, value));
return emitConstructorClass(
className,
f.newParameterizedType(
importer.toType(AbstractDirectOutputMapper.class),
importer.toType(slot.valueType)),
importer,
arguments);
}