From 90f2c6835a50676ed57b7f14a438062a3fb0ca37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 14 Oct 2010 14:42:13 +0200 Subject: [PATCH] Add some shell creators. --- src/main/java/net/pterodactylus/sone/data/PostShell.java | 9 +++++++++ src/main/java/net/pterodactylus/sone/data/ReplyShell.java | 9 +++++++++ src/main/java/net/pterodactylus/sone/data/SoneShell.java | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/data/PostShell.java b/src/main/java/net/pterodactylus/sone/data/PostShell.java index df66b20..7bcddfa 100644 --- a/src/main/java/net/pterodactylus/sone/data/PostShell.java +++ b/src/main/java/net/pterodactylus/sone/data/PostShell.java @@ -30,6 +30,15 @@ import java.util.UUID; */ public class PostShell extends Post implements Shell { + /** The shell creator. */ + public static final ShellCreator creator = new ShellCreator() { + + @Override + public Shell createShell() { + return new PostShell(); + } + }; + /** The GUID of the post. */ private UUID id; diff --git a/src/main/java/net/pterodactylus/sone/data/ReplyShell.java b/src/main/java/net/pterodactylus/sone/data/ReplyShell.java index 03a4c53..11a6ee5 100644 --- a/src/main/java/net/pterodactylus/sone/data/ReplyShell.java +++ b/src/main/java/net/pterodactylus/sone/data/ReplyShell.java @@ -27,6 +27,15 @@ import java.util.UUID; */ public class ReplyShell extends Reply implements Shell { + /** The shell creator. */ + public static final ShellCreator creator = new ShellCreator() { + + @Override + public Shell createShell() { + return new ReplyShell(); + } + }; + /** The Sone that posted this reply. */ private Sone sone; diff --git a/src/main/java/net/pterodactylus/sone/data/SoneShell.java b/src/main/java/net/pterodactylus/sone/data/SoneShell.java index 50b1189..49059c7 100644 --- a/src/main/java/net/pterodactylus/sone/data/SoneShell.java +++ b/src/main/java/net/pterodactylus/sone/data/SoneShell.java @@ -33,6 +33,15 @@ import freenet.keys.FreenetURI; */ public class SoneShell extends Sone implements Shell { + /** The shell creator. */ + public static final ShellCreator creator = new ShellCreator() { + + @Override + public Shell createShell() { + return new SoneShell(); + } + }; + /** A GUID for this Sone. */ private UUID id; -- 2.7.4