package net.pterodactylus.xdcc.data;
+import static java.lang.String.format;
+
+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;
return network().hashCode() ^ name().hashCode();
}
+ @Override
+ public String toString() {
+ return format("%s/%s", name(), network().name());
+ }
+
}