private Id<T> id;
- public RobustIdentifiable(String aPrefix, Identifiable<T> aIdentifiable) {
- notNull("prefix", aPrefix);
+ public RobustIdentifiable(Identifiable<T> aIdentifiable) {
notNull("identifiable", aIdentifiable);
try {
id = aIdentifiable.getId();
if (id == null) {
throwConfigException("identifiable.getId() returned null", null);
}
- id = new Id<T>(aPrefix + id.getId());
} catch (Exception e) {
throwConfigException("identifiable.getId() threw exception", e);
}
private void throwConfigException(String aMsg, Exception aException) {
LOGGER.log(Level.WARNING, aMsg, aException);
- throw new ConfigException("id is null");
+ throw new ConfigException(aMsg);
}
@Override
return id;
}
- // TODO test equals, hashcode.
-
@Override
public int hashCode() {
return id.hashCode();