All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ircclouds.irc.api.commands.JoinChanCmd Maven / Gradle / Ivy

There is a newer version: 1.0-0014
Show newest version
package com.ircclouds.irc.api.commands;

import com.ircclouds.irc.api.utils.*;

/**
 * 
 * @author
 * 
 */
public class JoinChanCmd implements ICommand
{
	private static final String JOIN = "JOIN";

	private String chanName;
	private String key;

	public JoinChanCmd(String aChanName)
	{
		this(aChanName, "");
	}

	public JoinChanCmd(String aChanName, String aKey)
	{
		chanName = aChanName;
		key = aKey;
	}
	
	public String asString()
	{
		return new StringBuffer().append(JOIN).append(" ").append(getChanName()).append(getKey()).append("\r\n").toString();
	}

	private String getKey()
	{
		return !StringUtils.isEmpty(key) ? " :" + key : "";
	}

	private String getChanName()
	{
		return chanName;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy