Java Generics <this??>
<p>Is there any way you could use a type of the class you're in for a generic argument? for example I have this class <code>ServiceNode</code></p>

<pre><code>public final class ServiceNode&lt;S extends NetworkService&gt; {

    private final S service;
    private final Client client;
    private Object attachment;

    public ServiceNode(S service, Client client) {
        this (service, client, null);
    }

    public ServiceNode(S service, Client client, Object attachment) {
        this.service = service;
        this.client = client;
        this.attachment = attachment;
    }

    public S service() {
        return service;
    }

....

}
</code></pre>

<p>which is a part of the abstract class <code>NetworkService</code></p>

<pre><code>public abstract class NetworkService {

    private final Set&lt;ServiceNode&lt;?&gt;&gt; registeredNodes = new HashSet&lt;&gt;();

    public final void register(ServiceNode&lt;?&gt; node) {
        registeredNodes.add(node);
    }

    ...

}
</code></pre>

<p>So basically is there anyway to remove the wildcard argument from <code>ServiceNode</code> in the <code>NetworkService</code> class and replace it with whatever type the class is extending <code>NetworkService</code></p>
