GAE for java Key object and Collection.contains() method

12 views
Skip to first unread message

Oliver Billing

unread,
Jun 28, 2012, 9:55:54 AM6/28/12
to google-a...@googlegroups.com

I just need to be sure that this is the case.

It seems  that the following does not work

//fetch entity with list of keys

if(entity.getProperty("keylist").contains(key)){ //Does not work!!
   //do something
}



Instead I have todo silly stuff like

for(Key k : entity.getProperty("keylist")){
           
if(KeyFactory.keyToString(k).equals(KeyFactory.keyToString(target.getKey()))){
              
//Do something
             

           
}
       
}
Reply all
Reply to author
Forward
0 new messages