I have such code:
public class Swarm {
    public SwarmEnemy getEnemy() {
        return new SwarmEnemy.SwarmEnemy1(SwarmEnemy.NORMAL_SWARM); // <-ERROR
    }
    private class SwarmEnemy extends BeamEnemy {
        public static final int NORMAL_SWARM = 0;
        public SwarmEnemy(int hp, int swarmType) {
            super(0, 0, hp, 0);
            switch (swarmType) {
                case 0:
                    System.out.println("constructor 1");
                    break;
            }
        }
        private class SwarmEnemy1 extends SwarmEnemy {
            public SwarmEnemy1(int swarmType) {
                super(25, swarmType);
            }
        }
        private class SwarmEnemy2 extends SwarmEnemy {
            public SwarmEnemy2(int swarmType) {
                super(25, swarmType);
            }
        }
    }
}
I tried to make Factory decorator. Anyway - this is error I get: An enclosing instance that contains Swarm.SwarmEnemy.SwarmEnemy1 is required What does it mean and how should I refactor my code to work?