Add container for an edition.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 9 Mar 2009 14:10:49 +0000 (15:10 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 9 Mar 2009 14:10:49 +0000 (15:10 +0100)
src/net/pterodactylus/arachne/core/Edition.java [new file with mode: 0644]

diff --git a/src/net/pterodactylus/arachne/core/Edition.java b/src/net/pterodactylus/arachne/core/Edition.java
new file mode 100644 (file)
index 0000000..5fbc41f
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * © 2009 David ‘Bombe’ Roden
+ */
+package net.pterodactylus.arachne.core;
+
+import de.ina.util.validation.Validation;
+
+/**
+ * Container for an edition. An edition is (contrary to the usual “freenet
+ * jargon”) a specific edition of a site.
+ *
+ * @author David ‘Bombe’ Roden <bombe@pterodactylus.net>
+ */
+public class Edition {
+
+       /** The site of the edition. */
+       private final Site site;
+
+       /** The edition number of the edition. */
+       private final int edition;
+
+       /**
+        * Creates a new edition.
+        *
+        * @param site
+        *            The site of the edition
+        * @param edition
+        *            The edition number of the edition
+        */
+       public Edition(Site site, int edition) {
+               Validation.begin().isNotNull("site", site).isPositive("edition", edition).check();
+               this.site = site;
+               this.edition = edition;
+       }
+
+       /**
+        * Returns the site of this edition.
+        *
+        * @return This edition’s site
+        */
+       public Site getSite() {
+               return site;
+       }
+
+       /**
+        * Returns the edition number of this edition.
+        *
+        * @return This edition’s edition number
+        */
+       public int getEdition() {
+               return edition;
+       }
+
+}