/** * list comma spearated list of ids * * @param statusTransitionRoles * @return */ public static String getIds(List objects) { if (objects == null) { return "empty"; } String ids = ""; for (Iterator iter = objects.iterator(); iter.hasNext(); ) { DataObject object = (DataObject) iter.next(); ids += object.getId() + (iter.hasNext() ? "," : ""); } return ids; }
/** * Check if the data model objects are equivalent to each other. * * @param left * @param right * @return */ public static boolean isEquivalent(DataObject left, DataObject right) { // if they are both null then return true if (left == null && right == null) { return true; } // at this point if either of them is null return false if (left == null || right == null) { return false; } // compare the ids return DataUtil.equals(left.getId(), right.getId()); }
/** * Return the id of the given data object * * @param object * @return */ public static Integer getId(DataObject object) { return object == null ? null : object.getId(); }