Thanks very much Stuart for the help. I was able to remove the unchecked
cast and maintain correct operation by modifying the code as follows:
public <T> Key<?> bindMultibinder(Named annotation, Class<T> superClass,
ArrayList<Class<? extends T>> contents) {
Multibinder<T> options = Multibinder.newSetBinder(binder(),
superClass, annotation);
for (Class<? extends T> t : contents) {
options.addBinding().to(t);
}
final Key<?> multibinderKey = Key.get(Types.setOf( superClass ),
annotation);
return multibinderKey;
}
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-guice/-/wLlj9DSwG8gJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.