Gets a value of the attribute for the specified key or throws an IllegalStateException if key does not exist