--- /dev/null
+/*
+ * XdccDownloader - Bot.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;
+
+import java.util.Collection;
+import java.util.Map;
+
+import com.beust.jcommander.internal.Maps;
+
+/**
+ * A bot is a client in a {@link Network} that carries {@link Pack}s which are
+ * available for download.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class Bot {
+
+ /** The network this bot is on. */
+ private final Network network;
+
+ /** The packs this bot carries. */
+ private final Map<String, Pack> packs = Maps.newHashMap();
+
+ /** The current name of the bot. */
+ private String name;
+
+ /**
+ * Creates a new bot.
+ *
+ * @param network
+ * The network the bot is on
+ */
+ public Bot(Network network) {
+ this.network = network;
+ }
+
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the network the bot is on.
+ *
+ * @return The network the bot is on
+ */
+ public Network network() {
+ return network;
+ }
+
+ /**
+ * Returns the current name of this bot.
+ *
+ * @return The current name of this bot
+ */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * Returns the packs this bot carries.
+ *
+ * @return The packs this bot carries
+ */
+ public Collection<Pack> packs() {
+ return packs.values();
+ }
+
+ //
+ // MUTATORS
+ //
+
+ /**
+ * Sets the current name of this bot.
+ *
+ * @param name
+ * The name of this bot
+ * @return This bot
+ */
+ public Bot name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ //
+ // ACTIONS
+ //
+
+ /**
+ * Adds the given pack to this bot.
+ *
+ * @param pack
+ * The pack to add
+ */
+ public void addPack(Pack pack) {
+ packs.put(pack.id(), pack);
+ }
+
+ //
+ // OBJECT METHODS
+ //
+
+ @Override
+ public String toString() {
+ return String.format("%s/%s", name(), network().name());
+ }
+
+}
--- /dev/null
+/*
+ * 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;
+ }
+
+}