public static final ShellCreator<Post> creator = new ShellCreator<Post>() {
@Override
- public Shell<Post> createShell() {
- return new PostShell();
+ public Shell<Post> createShell(String id) {
+ return new PostShell().setId(UUID.fromString(id));
}
};
public static final ShellCreator<Reply> creator = new ShellCreator<Reply>() {
@Override
- public Shell<Reply> createShell() {
- return new ReplyShell();
+ public Shell<Reply> createShell(String id) {
+ return new ReplyShell().setId(UUID.fromString(id));
}
};
*/
public T get(String id) {
if (!objectCache.containsKey(id)) {
- Shell<T> shell = shellCreator.createShell();
+ Shell<T> shell = shellCreator.createShell(id);
shellCache.put(id, shell);
return shell.getShelled();
}
/**
* Creates a new shell.
*
+ * @param id
+ * The ID of the shell object
* @return The new shell
*/
- public Shell<T> createShell();
+ public Shell<T> createShell(String id);
}
public static final ShellCreator<Sone> creator = new ShellCreator<Sone>() {
@Override
- public Shell<Sone> createShell() {
- return new SoneShell();
+ public Shell<Sone> createShell(String id) {
+ return new SoneShell().setId(UUID.fromString(id));
}
};