I'm trying to figure out how to test if a list of objects contains an object that contains a particular string as an attribute.
So here Is my list of objects
ArrayList<mObject> objectsList;
And here is my mObject
class
public class mObject {
String x = "True";
}
And here I try to make some kind of test
if(ObjectsList.contains(object.x == "True")){
return true;
} else {
return false;
}
I know the syntax is kind of ridiculous, but how can I make it technically correct?