title: Decorator pattern, EnumMap Populating is not working. Why?
body: <p>I want to give my characters a Role (like Driver, gunman etc...)with the Decorator design pattern.Not every Role needs all the skills, just some of them (for example, Partner In Crime Needs Startegy Only) .
   But When I want to create the different roles, program crashes.(I give my characters to the exact decorator later with the decision of the user.He chooses the members for the roles) As an example, Here I need only the Strategy Skill from the Member class (Because Partner In crime only uses that one). But when I am creating the EnumMap it is not working. How To solve this problem ?</p>
  
  <p>///Member Class</p>
  
  <pre><code>import java.util.*;
  
  public class Member implements Partner{
      String Name;
  
      int Share;
      //Creating the enum for the skills
      public static enum Skill {
          DRIVE, VEHICLE, ACCURACY, WEAPONS, REFLEX, STRATEGY, CHARISMA, HACKING, SPEED, STEALTH;
  
          public static Integer valueOf(Skill skill) {
              // TODO Auto-generated method stub
              return Member.skills.get(skill);
          }
      }
      //Creating an EnumMap to store the values and the names of the skills
      static Map&lt;Skill, Integer&gt; skills = new EnumMap&lt;Skill, Integer&gt;(Skill.class);
      Random r = new Random();
      //Constructor
      public Member(String Name) {
          this.Name = Name;
  
          skills.put(Skill.DRIVE, r.nextInt(100));
          skills.put(Skill.VEHICLE, r.nextInt(100));
          skills.put(Skill.ACCURACY, r.nextInt(100));
          skills.put(Skill.WEAPONS, r.nextInt(100));
          skills.put(Skill.REFLEX, r.nextInt(100));
          skills.put(Skill.STRATEGY, r.nextInt(100));
          skills.put(Skill.CHARISMA, r.nextInt(100));
          skills.put(Skill.HACKING, r.nextInt(100));
          skills.put(Skill.SPEED, r.nextInt(100));
          skills.put(Skill.STEALTH, r.nextInt(100));
      }
  
      public Map&lt;Skill, Integer&gt; getSkills() {
          return skills;
      }
      public Integer getSkill(Member.Skill skill) {
          return (Integer) skills.get(Skill.valueOf(skill));
      }
  
      public void setSkills(String skillname, int number) {
          skills.put(Skill.valueOf(skillname), number);
      }
  }
  </code></pre>
  
  <p>///Partner Interface</p>
  
  <pre><code>public interface Partner {
      //Creating the enum for the skills
      public static enum Skill {
          DRIVE, VEHICLE, ACCURACY, 
  WEAPONS, REFLEX, STRATEGY, CHARISMA, HACKING, SPEED, STEALTH;
      }
  
  
  }
  </code></pre>
  
  <p>///RoleDecorator class</p>
  
  <pre><code>public class RoleDecorator implements Partner {
      protected Partner DecoratedPartner;
      public RoleDecorator(Partner DecoratedPartner){
          this.DecoratedPartner=DecoratedPartner;
      }   
  
  }
  </code></pre>
  
  <p>////PartnerInCrime Class Something is bad here...</p>
  
  <pre><code>import java.util.*;
  
  
  
  public class PartnerInCrime extends RoleDecorator {
      Member.Skill STRATEGY;
      Random r = new Random();
  
       Map&lt;Member.Skill, Integer&gt; skill=new EnumMap&lt;Member.Skill, Integer&gt;(Member.Skill.class);
      public PartnerInCrime(Partner DecoratedPartner) {
          super(DecoratedPartner);
          skill.put(STRATEGY, Member.Skill.valueOf(STRATEGY));
      }
  
  
  
      public Map&lt;Member.Skill, Integer&gt; getskill() {
          return skill;
      }
  }
  </code></pre>