Note this is not multi-threading case Old value is saved in cache, new value is getting from server and final value is updated-one which will save again in cache.
Their two object of class name
- obj->Old values,
- obj1-> New values.
Recquried
- obj3-> Final Output.
Old Values
class A{
String name="abc";
String email="x@gmail.com";
String phone="123456789";
}
New Values
class A{
String name="xyz";
String email="";
}
Want to update old values with new values only when their is some updated content in new values.
As in above case
- name is accepted as it changes
- email is not accepted as it is empty.
- Phone has no value so rejected.
Final output is:
class A
{
String name="xyz";
String email="x@gmail.com";
String phone="123456789";
}
Is their any easy solution to make it simple