Consider the below code:
class TestSUid implements Serializable {
private static final Long serialVersionUID =101010101010L;
private String title;
private Error error;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Error getError() {
return error;
}
public void setError(Error error) {
this.error = error;
}
}
class Error implements Serializable {
private String title;
private String message;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
Now my objective is to serialize the TestSUid class so that I can enable offline caching. I am confused on the part if I need to add a serialVersionUID to my Error class as well. What if I need to update the error class in future would updating the TestSUid version id be enough?
I have gone through the reference at: https://docs.oracle.com/javase/8/docs/platform/serialization/spec/version.html#a6678
But still dont feel entirely confident.