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

com.ircclouds.irc.api.utils.ParseUtils Maven / Gradle / Ivy

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

import com.ircclouds.irc.api.domain.*;
import com.ircclouds.irc.api.domain.messages.interfaces.*;

/**
 * 
 * @author
 * 
 */
public final class ParseUtils
{

	private ParseUtils()
	{

	}

	public static IRCUser getUser(String aString)
	{
		String[] _cmpnts1 = aString.split("@");
		String[] _cmpnts2 = _cmpnts1[0].split("!");

		IRCUser _user = new IRCUser();
		_user.setHostname(_cmpnts1[1]);
		_user.setNick(_cmpnts2[0].substring(1));
		_user.setIdent(_cmpnts2[1]);

		return _user;
	}

	public static ISource getSource(String aString)
	{
		if (aString.contains("@"))
		{
			return getUser(aString);
		}
		
		return new IRCServer(aString);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy