protected Identity identity;
protected boolean local;
+ protected long lastUpdated;
@Override
public SoneBuilder from(Identity identity) {
return this;
}
+ @Override
+ public SoneBuilder lastUpdated(long lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ return this;
+ }
+
protected void validate() throws IllegalStateException {
checkState(identity != null, "identity must not be null");
checkState(!local || (identity instanceof OwnIdentity),
"can not create local Sone from remote identity");
+ checkState(lastUpdated > 0, "last update time must be set");
}
}