String className = obj.getClass().getName();
className = className.replace("com.art.anette.datamodel.dataobjects.", "");
final StringBuilder sb = new StringBuilder().append(className).append(' ').append(obj.toString());
if (obj instanceof DataObject) {
DataObject dataObject = (DataObject) obj;
sb.append(" pk=").append(dataObject.getPrimaryKey());
if (dataObject.isNew()) {
sb.append(" new");
}
if (dataObject.isModified()) {
sb.append(" modified");
}
if (dataObject.isRemoved()) {
sb.append(" removed");
}
if (dataObject.isStub()) {
sb.append(" stub");
}
if (dataObject.isValid()) {
sb.append(" valid");
}
sb.append(' ').append(dataObject.toDetailString());
}
return sb.toString();
}