Java generics: bound class extend class OR 2 interfaces
<p>I've done some reading on defining a bounded type parameters like</p>

<pre><code>abstract class AbstractClass &lt; T extends ClassA &gt;

abstract class AbstractClass &lt; T extends InterfaceSeq &amp; InterfaceClone &gt;
</code></pre>

<p>My problem is the following. My <code>AbstractClass</code> needs to have access to a data object's (T) following methods:</p>

<pre><code>getSeq() - gets sequence number of data object

_clone() - additional cloning logic of the data object
</code></pre>

<p>Both these methods are present under <code>ClassA</code>. The problem is, <code>ClassA</code> was introduced two years ago.</p>

<p>There are old data classes that implement <code>InterfaceSeq</code> (has <code>getSeq()</code>) and <code>InterfaceClone</code> (has <code>_clone()</code>):</p>

<pre><code> DataClassA extends ClassA

 DataClassB implements InterfaceSeq, InterfaceClone
</code></pre>

<p>Both <code>DataClassA</code> &amp; <code>DataClassB</code> have the 2 methods I need, but I'm having a hard time defining that logic in my <code>AbstractClass</code>.</p>

<p>Right now I have:</p>

<pre><code>AbstractClass &lt; T extends ClassA &gt;
</code></pre>

<p>I need something like</p>

<pre><code>AbstractClass &lt; T extends ClassA or (InterfaceSeq &amp; InterfaceClone) &gt;
</code></pre>

<p>Migrating the old classes to use <code>ClassA</code> is too complex. Any suggestion is appreciated.</p>