From: David ‘Bombe’ Roden Date: Mon, 18 Feb 2013 20:58:08 +0000 (+0100) Subject: Add constructors. X-Git-Tag: 0.1~25 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e756bd3f340862312390820f52d080b54ec389af;p=rhynodge.git Add constructors. --- 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 //