I need to accomplish the following (this is a simplified version):
enum Animals{
enum Cats{tabby("some value"), siamese("some value")},
enum Dogs{poodle("some value"), dachsund("some value")},
enum Birds{canary("some value"), parrot("some value")}
private String someValue = "";
private ShopByCategory(String someValue)
{
this.someValue = someValue;
}
public String getSomeValue()
{
return this.someValue;
}
}
So that I can access these items as follows:
string cat1 = Animals.Cats.tabby.getSomeValue;
string dog1 = Animals.Dogs.dachsund.getSomeValue;
string bird1 = Animals.Birds.canary.getSomeValue;
The reason why I am attempting to do this with enums is the fact that I need to be able to access each tier without having to a) instantiate a class, b) hide the names of the tiers behind a method name, or c) use an iterator to go through an EnumSet.
Is this at all possible? What would you suggest instead of enums?