private GenderInvestigationVo isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, Investigation doInv) { if (instGenderSpecific != null) { if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE)) { if (instGenderSpecific.equals(GenderSpecific.FEMALE)) { if (!isFemale) return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762 } else if (instGenderSpecific.equals(GenderSpecific.MALE)) { if (isFemale) return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762 } } } return null; }
private GenderInvestigationVoCollection listGenderMessages(Investigation doInv, boolean female, GenderInvestigationVo parentInv)//WDEV-16762 { if(doInv == null) return null; GenderInvestigationVoCollection messages = new GenderInvestigationVoCollection();//WDEV-16762 if(Boolean.TRUE.equals(doInv.getInvestigationIndex().isIsProfile())) { GenderInvestigationVo profileInv = isInvAppropriate(assembleGenderSpecific(doInv.getInvestigationIndex().getGenderSpecific()), female, doInv);//WDEV-16762 boolean isProfileAdded = false;//WDEV-16762 //WDEV-16762 if(profileInv != null) { isProfileAdded = true; messages.add(profileInv); } else { profileInv = GenderInvestigationVoAssembler.create(doInv);//WDEV-16762 } if(doInv.getAssocInvestigations() != null) { Iterator it = doInv.getAssocInvestigations().iterator(); while(it.hasNext()) { Object comp = it.next(); if(!(comp instanceof Investigation)) continue; addGenderMessagesCollection(messages, listGenderMessages((Investigation)comp, female, profileInv));//WDEV-16762 } //WDEV-16762 if(profileInv!= null && profileInv.getAssocInvestigation() != null && profileInv.getAssocInvestigation().size() > 0 && !isProfileAdded) { messages.add(profileInv); } return messages; } } GenderInvestigationVo childInv = isInvAppropriate(assembleGenderSpecific(doInv.getInvestigationIndex().getGenderSpecific()), female, doInv);//WDEV-16762 //WDEV-16762 if(parentInv != null) { if(parentInv.getAssocInvestigation() == null) parentInv.setAssocInvestigation(new GenderInvestigationVoCollection()); parentInv.getAssocInvestigation().add(childInv); } else { messages.add(childInv); } return messages; }