Add constructors.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Feb 2013 20:58:08 +0000 (21:58 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Feb 2013 21:38:39 +0000 (22:38 +0100)
src/main/java/net/pterodactylus/rhynodge/states/TorrentState.java

index 22da77f..c0ba68a 100644 (file)
@@ -44,6 +44,23 @@ public class TorrentState extends AbstractState implements Iterable<TorrentFile>
        @JsonProperty
        private List<TorrentFile> files = Lists.newArrayList();
 
+       /**
+        * Creates a new torrent state without torrent files.
+        */
+       public TorrentState() {
+               this(Collections.<TorrentFile> emptySet());
+       }
+
+       /**
+        * Creates a new torrent state containing the given torrent files.
+        *
+        * @param torrentFiles
+        *            The torrent files
+        */
+       public TorrentState(Collection<TorrentFile> torrentFiles) {
+               files.addAll(torrentFiles);
+       }
+
        //
        // ACCESSORS
        //