Get an attribute of a class with another attribute
<p>I've got a fundamental problem.</p>

<p>There are several classes, extending another one ("Skill").<br>
"Skill" contains some abstract methods like:</p>

<pre><code>public abstract int getID();
public abstract String getName();
public abstract String getDescription();
</code></pre>

<p>and the subclasses:</p>

<pre><code>@Override
public int getID()
{
    return 69;
}

@Override
public String getName()
{
    return "name";
}

@Override
public String getDescription()
{
    return "description";
}
</code></pre>

<p>Now, let's say i need to get the description of the subclass with the id "89".<br><br>
Is there an easier way of doing this, than having a HashMap storing id->classname and then getting an object of the class by doing the following?:</p>

<pre><code>Class cl = Class.forName(classname);
Object o = cl.getConstructor().newInstance();
Method m = cl.getMethod("getDescription");
return (String) m.invoke(o);
</code></pre>
