Add bots and packs.
[xudocci.git] / src / main / java / net / pterodactylus / xdcc / data / Pack.java
diff --git a/src/main/java/net/pterodactylus/xdcc/data/Pack.java b/src/main/java/net/pterodactylus/xdcc/data/Pack.java
new file mode 100644 (file)
index 0000000..1ec5a09
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * XdccDownloader - Pack.java - Copyright © 2013 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.xdcc.data;
+
+/**
+ * A pack is a downloadable file offered by a {@link Bot}.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class Pack {
+
+       /** The ID of the pack. */
+       private final String id;
+
+       /** The size of the pack. */
+       private final String size;
+
+       /** The name of the pack. */
+       private final String name;
+
+       /**
+        * Creates a new pack.
+        *
+        * @param id
+        *              The ID of the pack
+        * @param size
+        *              The size of the pack
+        * @param name
+        *              The name of the pack
+        */
+       public Pack(String id, String size, String name) {
+               this.id = id;
+               this.size = size;
+               this.name = name;
+       }
+
+       //
+       // ACCESSORS
+       //
+
+       /**
+        * Returns the ID of the pack. The ID is only guaranteed to be unique within a
+        * single {@link Bot}.
+        *
+        * @return The ID of the pack
+        */
+       public String id() {
+               return id;
+       }
+
+       /**
+        * Returns the size of the pack. The size can contain decimal fractions and
+        * unit denotifiers, such as “1.2G”.
+        *
+        * @return The size of the pack
+        */
+       public String size() {
+               return size;
+       }
+
+       /**
+        * Returns the name of the pack. This is usually the name of the single file
+        * that makes up this pack.
+        *
+        * @return The name of the pack
+        */
+       public String name() {
+               return name;
+       }
+
+}