I'd like to know if it is possible in Java to nest Enums.
Here what i'd like to be able to do :
Have an enum Species made of CAT and DOG wich would grant me access to sub enums of the available CAT and DOG breeds. For example, i'd like to be able to test if wether a CAT or a DOG and if an animal is a PERSAN CAT or a PITBULL DOG. CAT and DOG breeds must be distinct enums ,i.e a CatBreeds enum and a DogBreeds enum.
Here is an example of access pattern i'd like to use :
Species :
- Species.CAT
- Species.DOG
Breeds :
- Species.CAT.breeds.PERSAN
- Species.DOG.breeds.PITBULL