// TODO test this class.
// TODO test that id is constant even though delegated changes its id.
- public RobustIdentifiable(Identifiable<T> aIdentifiable) {
+ public RobustIdentifiable(String aPrefix, Identifiable<T> aIdentifiable) {
// TODO test id is null
// TODO getId() throws exception
try {
id = aIdentifiable.getId();
if (id == null) {
id = new Id<T>(Constants.UNKNOWN_ID.toString());
- throw new RuntimeException(
- "Temporary to catch nulls during refactoring");
+ temporarilyThrowException();
+ } else {
+ id = new Id<T>(aPrefix + id.getId());
}
} catch (Exception e) {
LOGGER
}
+ private void temporarilyThrowException() {
+ throw new RuntimeException(
+ "Temporary to catch nulls during refactoring");
+ }
+
@Override
public Id<T> getId() {
return id;