Is it possible to somehow iterate over every method of an object, with name starting with "get"? I want to compare two very complex custom objects, that have fields consisting of data structures based on other custom objects. What I want to do is to get a hashcode of the result of every get method, and compare if they are equal for every field.
Sorry if it is not very understandable, if you have questions please ask. Thanks for any help and suggestions
I thought of something like that:
for(method m : gettersOfMyClass){
boolean same = object1.m.hashCode() == object2.m.hashCode()
}