From e756bd3f340862312390820f52d080b54ec389af Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 18 Feb 2013 21:58:08 +0100 Subject: [PATCH] Add constructors. --- .../net/pterodactylus/rhynodge/states/TorrentState.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/net/pterodactylus/rhynodge/states/TorrentState.java b/src/main/java/net/pterodactylus/rhynodge/states/TorrentState.java index 22da77f..c0ba68a 100644 --- a/src/main/java/net/pterodactylus/rhynodge/states/TorrentState.java +++ b/src/main/java/net/pterodactylus/rhynodge/states/TorrentState.java @@ -44,6 +44,23 @@ public class TorrentState extends AbstractState implements Iterable @JsonProperty private List files = Lists.newArrayList(); + /** + * Creates a new torrent state without torrent files. + */ + public TorrentState() { + this(Collections. emptySet()); + } + + /** + * Creates a new torrent state containing the given torrent files. + * + * @param torrentFiles + * The torrent files + */ + public TorrentState(Collection torrentFiles) { + files.addAll(torrentFiles); + } + // // ACCESSORS // -- 2.7.4