Here is the relevant code:
public interface Artifact {} public interface Bundle implements Artifact {} public interface Component implements Artifact {} public interface State<T extends Artifact> { void transition(T artifact, State<T> nextState); }
This allows me to define this enumeration:
enum BundleState implements State<Bundle> { A, B, C; public void transition(Bundle bundle, State<Bundle> nextState) {} } }
But the signature of the method I want is:
public void transition(Bundle bundle, BundleState nextState) {} }
But this does not compile. Obviously, the problem is how I defined T in the State interface, but I cannot figure out how to fix this.
Thanks Don
source share