Even a hash map with fully qualified names as keys wouldn't be so bad because Stirng is immutable in Java, so the hash code can be cached on the object.