https://kotlinlang.org logo
#announcements
Title
# announcements
m

mg6maciej

04/27/2017, 8:58 PM
Speaking of reflections. Anybody knows if there is a library for diffing data class objects?
t

trevjones

04/27/2017, 9:07 PM
I once wrote an apt tool that would map an object out to Map<String,String> so that I could diff and only make api calls with what changed. what would you expect the output to be for such a comparison
m

mg6maciej

04/27/2017, 9:14 PM
I have a deep structure of data classes and want to know which parts of the structure changed. So the output of diff on two objects of the same data class would be a list I can iterate over with objects like this:
Diff("someList.size", 0, 3)
// when some prop list size changed or
Diff("otherList[2].name", "old", "new")
// when element at position 2 has it's name property changed
Maybe strings there could be replaced with something better.
2 Views