Implement wrapper for Object class that will control access to that object and if something changes it will push event to Subject.
public class ObjectChanges extends Object or Implements its interface {
private Object mObject;
private Subject<Object> subject;
<constructor that takes mObject>
public void setField(String value) {
mObject.setField(value);
subject.onNext(mObject)
}
public Observable<Object> subscribe() {
return (Observable<Object>) this.subject;
}
...
}
You can use decorator pattern for it as well. I advice you to not add this logic Object because then it may cause a lot of architectural problems. For example you may want to implement another wrapper that will validate fields of that object, will you do it in Object too? On the other hand you will just implement that wrapper and use it where you want:
Object obj = new ValidationWrapper(new RxWrapper(new Object()));