Hello, I want to find an object in a list (with a ...
# announcements
m
Hello, I want to find an object in a list (with a
find
). Input is a list of string containing json data. For each entry, I need to parse the string and check if a property is equal to my value. How I do :
Copy code
list.map { gson.parse<MyData>(it) }.find { it.id == inputId }
It works but I doesn't want to parse all data then find the right object, I want to parse an entry then check equality then if not equal, check the next entry, and so on How can I do ?