package net.pterodactylus.xdcc.core;
+import static net.pterodactylus.xdcc.data.Channel.TO_NETWORK;
import static net.pterodactylus.xdcc.data.Download.FILTER_RUNNING;
import java.io.File;
}
/**
+ * Returns all defined networks.
+ *
+ * @return All defined networks
+ */
+ public Collection<Network> networks() {
+ return FluentIterable.from(channels).transform(TO_NETWORK).toSet();
+ }
+
+ /**
* Returns all configured channels. Due to various circumstances, configured
* channels might not actually be joined.
*
package net.pterodactylus.xdcc.data;
+import com.google.common.base.Function;
+
/**
* Defines a channel in a {@link Network}.
*
*/
public class Channel {
+ /** Function to convert a channel to its network. */
+ public static final Function<Channel, Network> TO_NETWORK = new Function<Channel, Network>() {
+ @Override
+ public Network apply(Channel channel) {
+ return channel.network();
+ }
+ };
+
/** The network this channel belongs to. */
private final Network network;