java - Finding if the list contains same data? -


here want if list.cust.getcomponentidentification() value contains same value want pick value.

for(customizablemenus cust : ra.getaction().getcustomizablemenu()){                          cust.getcomponentid();                         cust.getcomponentidentification();                         cust.getcomponentname();                         cust.getcomponentstate();                         custlist.add(cust); } 

if user having same componentidentification want find respective component identification.

as far understand, want find if list same thing user has.

pretending there's object "user", can this:

user user = new user(); (customizablemenus cust : ra.getaction().getcustomizablemenu()){     if (user.getcomponentidentification() == cust.getcomponentidentification()) {         // whatever need it.         // might add break here.     } } 

please let me know if it's not needed, can improve answer.


Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -