Class IRCUser


  • public class IRCUser
    extends java.lang.Object
    Holds variables for the nick, username and host of a user.

    It's used to pack these information in one object.

    See Also:
    IRCEventListener, IRCParser
    • Constructor Summary

      Constructors 
      Constructor Description
      IRCUser​(java.lang.String nick, java.lang.String username, java.lang.String host)
      Creates a new IRCUser object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHost()
      Returns the host of the person who sent the line.
      java.lang.String getNick()
      Returns the nickname of the person who sent the line or the servername of the server which sent the line.
      java.lang.String getServername()
      Returns the servername of the server which sent the line or the nickname of the person who sent the line.
      java.lang.String getUsername()
      Returns the username of the person who sent the line.
      java.lang.String toString()
      Returns the nickname.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IRCUser

        public IRCUser​(java.lang.String nick,
                       java.lang.String username,
                       java.lang.String host)
        Creates a new IRCUser object.
        Parameters:
        nick - The user's nickname.
        username - The user's username.
        host - The user's host.
    • Method Detail

      • getNick

        public java.lang.String getNick()
        Returns the nickname of the person who sent the line or the servername of the server which sent the line.
        If no nickname is given, null is returned.

        Note: This method is totally equal to getServername!
        Returns:
        The nickname or the servername of the line. If no nick is given, null is returned.
        See Also:
        getServername(), getUsername(), getHost()
      • getServername

        public java.lang.String getServername()
        Returns the servername of the server which sent the line or the nickname of the person who sent the line.
        If no nickname is given, null is returned.

        Note: This method is totally equal to getNick!
        Returns:
        The servername or the nickname of the line. If no server is given, null is returned.
        See Also:
        getNick()
      • getUsername

        public java.lang.String getUsername()
        Returns the username of the person who sent the line.
        If the username is not specified, this method returns null.
        Returns:
        The username of the line; null if it's not given.
        See Also:
        getNick(), getHost()
      • getHost

        public java.lang.String getHost()
        Returns the host of the person who sent the line.
        If the host is not specified, this method returns null.
        Returns:
        The host of the line; null if it's not given.
        See Also:
        getNick(), getUsername()
      • toString

        public java.lang.String toString()
        Returns the nickname.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The nickname.