private boolean validateReplaceeReplacer(PersonMassChange personMassChange) { boolean isValid = true; if (personMassChange.getReplaceePersonId() == null && personMassChange.getReplaceeRolodexId() == null) { isValid = false; reportError(REPLACEE_FULL_NAME_FIELD, KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACEE_EMPTY); return isValid; } if (personMassChange.getReplacerPersonId() == null && personMassChange.getReplacerRolodexId() == null) { isValid = false; reportError(REPLACER_FULL_NAME_FIELD, KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACER_EMPTY); return isValid; } if ((personMassChange.getReplacerPersonId() != null && StringUtils.equalsIgnoreCase( personMassChange.getReplacerPersonId(), personMassChange.getReplaceePersonId())) || (personMassChange.getReplacerRolodexId() != null && StringUtils.equalsIgnoreCase( String.valueOf(personMassChange.getReplacerRolodexId()), String.valueOf(personMassChange.getReplaceeRolodexId())))) { isValid = false; reportError(REPLACER_FULL_NAME_FIELD, KeyConstants.ERROR_PERSON_MASS_CHANGE_SAME_PERSONS); } return isValid; }
private boolean validateRolodex( PersonMassChange personMassChange, String propertyName, String typeText) { boolean isValid = true; if (!isReplaceeRolodex( personMassChange.getReplaceePersonId(), personMassChange.getReplaceeRolodexId())) { isValid = false; reportError( propertyName, KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACEE_SELECTION, EMPLOYEE, typeText); } if (!isReplacerRolodex( personMassChange.getReplacerPersonId(), personMassChange.getReplacerRolodexId())) { isValid = false; reportError( propertyName, KeyConstants.ERROR_PERSON_MASS_CHANGE_REPLACER_SELECTION, typeText, EMPLOYEE); } return isValid; }