public int compareTo(LFObjective lfObjective) { long primaryKey = lfObjective.getPrimaryKey(); if (getPrimaryKey() < primaryKey) { return -1; } else if (getPrimaryKey() > primaryKey) { return 1; } else { return 0; } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } LFObjective lfObjective = null; try { lfObjective = (LFObjective) obj; } catch (ClassCastException cce) { return false; } long primaryKey = lfObjective.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } }