I have a POJO class.
class Activity{
private String name;
public String getName()
return name;
}
public void setName(String name){
this.name=name;
}
}
im having belw condtions.its not enr=ering properly in those condtions accordingly
if(stlmtTransRequestVO.getStlmtTransId()!=null && stlmtTransRequestVO.getPaymentTransId()!=null){
stlmtTransDtlsList = (List<StlmtTransResponseVO>) queryForList(
"GET_STLMTPAY_TRANSACTIONS", stlmtTransRequestVO);
}else if(stlmtTransRequestVO.getAgentId()!=null && stlmtTransRequestVO.getAgencyId()==null){
stlmtTransDtlsList = (List<StlmtTransResponseVO>) queryForList(
"GET_AGENT_TRANSACTIONS", stlmtTransRequestVO);
}else if(stlmtTransRequestVO.getAgencyId()!=null && stlmtTransRequestVO.getAgentId()==null){
stlmtTransDtlsList = (List<StlmtTransResponseVO>) queryForList(
"GET_AGENCY_TRANSACTIONS", stlmtTransRequestVO);
}else if(stlmtTransRequestVO.getAgencyId()!=null && stlmtTransRequestVO.getAgentId()!=null){
}
How to check this getter method for having data or not?
I have tried below scenarios but not working
1) obj.getName()!=null
2) obj.getName().isEmpty()
Above is checking that name is not null and also it’s not empty. Also “”.equals(obj.getName()) is considered better approach than obj.getName().equals(“”).