/** * Updates the stored user with any not null information in the passed user * * @param u The user to update from. * @throws InvalidFieldException Thrown if anything is of the wrong format. */ public void update(User u) throws InvalidFieldException { if (u.getFirstName() != null) { setFirstName(u.getFirstName()); } if (u.getLastName() != null) { setLastName(u.getLastName()); } if (u.getID() != null) { setID(u.getID()); } if (u.getPoints() != getPoints()) { setPoints(u.getPoints()); } if (u.getWeeklyPick() != null && !u.getWeeklyPick().isNull()) { setWeeklyPick(u.getWeeklyPick()); } if (u.getUltimatePick() != null && !u.getUltimatePick().isNull()) { setUltimatePickNoSetPts(u.getUltimatePick()); } if (u.getUltimatePoints() != getUltimatePoints()) { setUltimatePoints(u.getUltimatePoints()); } }