This question may sound silly, but I have no idea how to solve this:
I have some enumerated classes that model some constants for an application I’m developing, e.g.:
public enum Daily{GROCERIES, SUPPLIES,....}
public enum Monthly{NEWSPAPER, MAGAZINES,....}
public enum BiMonthly{....}
And let’s say I have an object that has a field modeled after any of the previous enums:
public class SomeObject{
...
private Daily/Monthly/ByMonthly category;
...
}
how can I model this? I don’t know if putting all of the enums in a class and making the field of my object of type Something<E extends Enum> or making an interface with no methods that all my enums implement and making the field of my object of type EnumInterface.
Thanks
I think you should structure your Enums/Classes differently. Something like: