@Override
public E setUnique(int index, E newValue) {
if (model.getModelState() != ModelState.LOADING) {
try {
if (newValue instanceof String) {
model.getBimServerClient().getLowLevelInterface().setStringAttributeAtIndex(model.getTransactionId(), subject.getOid(), feature.getName(), index, (String) newValue);
} else if (newValue instanceof Double) {
model.getBimServerClient().getLowLevelInterface().setDoubleAttributeAtIndex(model.getTransactionId(), subject.getOid(), feature.getName(), index, (Double) newValue);
} else if (newValue instanceof Boolean) {
model.getBimServerClient().getLowLevelInterface().setBooleanAttributeAtIndex(model.getTransactionId(), subject.getOid(), feature.getName(), index, (Boolean) newValue);
} else if (newValue instanceof Integer) {
model.getBimServerClient().getLowLevelInterface().setIntegerAttributeAtIndex(model.getTransactionId(), subject.getOid(), feature.getName(), index, (Integer) newValue);
} else if (newValue instanceof IdEObject) {
model.getBimServerClient().getLowLevelInterface()
.addReference(model.getTransactionId(), subject.getOid(), feature.getName(), ((IdEObject) newValue).getOid());
} else {
throw new RuntimeException("Unimplemented " + feature.getEType().getName() + " " + newValue);
}
} catch (ServerException e) {
LOGGER.error("", e);
} catch (UserException e) {
LOGGER.error("", e);
} catch (PublicInterfaceNotFoundException e) {
LOGGER.error("", e);
}
}
return delegate.setUnique(index, newValue);
}