Hi,
Here's 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 enum:
enum BundleState implements State<Bundle> {
A, B, C;
public void transition(Bundle bundle, State<Bundle> nextState) {}
}
}
But the method signature that I want is:
public void transition(Bundle bundle, BundleState nextState) {}
}
But this does not compile. Obviously the problem lies with how I've defined T
in the State
interface, but I can't figure out know how to fix it.
Thanks, Don