Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public class Example {
  2. interface MyType {
  3. // Add methods here
  4. }
  5.  
  6. private List<what-goes-here?> store = new ArrayList<>();
  7.  
  8.  
  9. public <T extends Enum<?> & MyType> void registerType(@Nonnull Class<T> type) {
  10. store.add(type);
  11. }
  12.  
  13.  
  14. public void processAll() {
  15. for (T t : store) { // Where do I define T?
  16. // process t
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement