Is there anyway to use a bounded wildcard require a class implement more than one interface?
In otherwords, something like…
class Foo<S extends Comparable && Clonable>
…which would require that objects extend both interfaces?
I realize I can make another ComparableAndClonable which extends the two but I don’t have control over some of the code (So I can’t go make my future-S object implement ComparableAndClonable).
Should work.
See Java Generics Wildcarding With Multiple Classes for further info.
[1]: