Is there in java a way to write generic interface what points out to the implementor of such interface in more convenient way?
For example I've write interface:
public interface Updatable<T> {
void updateData(T t);
}
I want to point out that only instance of implementor can be passed in updateData(T t) method.
So, i have to write something like this:
public class Office implements Updatable<Office> {
@Override
public void updateData(Office office) {
//To change body of implemented methods use File | Settings | File Templates.
}
...
...
...
}
But seems it is a little ugly. Do you have better variants?