I have an class with a static interface within it.
public class UserInfo {
private Store userInfoStore;
public static interface Store {
UserInfo save(UserInfo userInfo);
}
public UserInfo save() {
if (userInfoStore == null) return null;
return userInfoStore.save(this);
}
}
I then have an object which implements the above object's interface
public class UserAuditService implements UserInfo.Store {
@Override
public UserInfo save(UserInfo userInfo) {
// code that persists object to disk
}
}
Now say I'm creating an instance of the UserInfo object somewhere else in my application. How do I reference the save method implemented in the UserAuditService class?
UserInfo userInfo = new UserInfo();
??? - Not sure what to do here.
UserInfonow what next you want to do?