I use a static enum in an interface and want to use it in an extending class.
I have following interfaces:
public interface StateSupport {
public static enum State {
NEW,
UNCHANGED,
UPDATED;
}
}
and
public interface Support extends StateSupport {
public void do(Context arg0);
}
and finally a class
public class MyClassUtil implements Support {
public void do(Context arg0){
MyClass obj = new MyClass(NEW);
}
}
The point is that I dont want to write “State.NEW”, just “NEW” 🙂
So how can it do that without using the enum name. Is there a way at all?
You can use a static import:
or in short (discouraged):