Cyclic inheritance when implementing inner interface in enum
This would be because you are implementing (coding) the interface you are implementing (inheriting) inside of the class that is inheriting from that class.
I wish I could make that sentence better...
But here is a visual example.
Class A implements Interface B {
Interface B {
}
}
As far as I know, this is not allowed. You need to define the interface outside of the class (in this case, an Enum).
Like so:
Interface B {
}
Class A implements Interface B {
}
Best practice is probably to break them up into different files.
You can see here what's mistake in your code ?
public enum FusionStat implements MonsterStatBuilderHelper {
protected interface MonsterStatBuilderHelper extends MonsterStatBuilder {
}
}
first you are implementing MonsterStatBuilderHelper
for FusionStat
enum again inside the enum
written one more time with the same name interface MonsterStatBuilderHelper
which you are already implementing for top level enum
so that's why you are getting cyclic inheritance error.
You can see below some few cyclic inheritance example
//1st example
class Person extends Person {} //this is not possible in real world, a Person itself child and parent both ?
//2nd example
class Human extends Person{}
class Person extends Human{}
Notes : cyclic inheritance is not supported in java because logically it's not possible.