PircBot Java IRC Bot

## org.jibble.pircbot
Class User

    java.lang.Object
      org.jibble.pircbot.User

public class User
extends Object

This class is used to represent a user on an IRC server. Instances of this class are returned by the getUsers method in the PircBot class.

Note that this class no longer implements the Comparable interface for Java 1.1 compatibility reasons.

Since:
  1.0.0
Version:
  1.5.0 (Build time: Mon Dec 14 20:07:17 2009)
Author:
  Paul James Mutton, http://www.jibble.org/

Method Summary
`int` `compareTo(Object o)` Returns the result of calling the compareTo method on lowercased nicks.
`boolean` `equals(Object o)` Returns true if the nick represented by this User object is the same as the nick of the User object given as an argument.
`boolean` `equals(String nick)` Returns true if the nick represented by this User object is the same as the argument.
`String` `getNick()` Returns the nick of the user.
`String` `getPrefix()` Returns the prefix of the user.
`int` `hashCode()` Returns the hash code of this User object.
`boolean` `hasVoice()` Returns whether or not the user represented by this object has voice.
`boolean` `isOp()` Returns whether or not the user represented by this object is an operator.
`String` `toString()` Returns the nick of the user complete with their prefix if they have one, e.g.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Method Detail

### getPrefix

    public String getPrefix()

  Returns the prefix of the user. If the User object has been obtained from a list of users in a channel, then this will reflect the user's status in that channel.

  Returns:
    The prefix of the user. If there is no prefix, then an empty String is returned.

### isOp

    public boolean isOp()

  Returns whether or not the user represented by this object is an operator. If the User object has been obtained from a list of users in a channel, then this will reflect the user's operator status in that channel.

  Returns:
    true if the user is an operator in the channel.

### hasVoice

    public boolean hasVoice()

  Returns whether or not the user represented by this object has voice. If the User object has been obtained from a list of users in a channel, then this will reflect the user's voice status in that channel.

  Returns:
    true if the user has voice in the channel.

### getNick

    public String getNick()

  Returns the nick of the user.

  Returns:
    The user's nick.

### toString

    public String toString()

  Returns the nick of the user complete with their prefix if they have one, e.g. "@Dave".

  Returns:
    The user's prefix and nick.

### equals

    public boolean equals(String nick)

  Returns true if the nick represented by this User object is the same as the argument. A case insensitive comparison is made.

  Returns:
    true if the nicks are identical (case insensitive).

### equals

    public boolean equals(Object o)

  Returns true if the nick represented by this User object is the same as the nick of the User object given as an argument. A case insensitive comparison is made.

  Returns:
    true if o is a User object with a matching lowercase nick.

### hashCode

    public int hashCode()

  Returns the hash code of this User object.

  Returns:
    the hash code of the User object.

### compareTo

    public int compareTo(Object o)

  Returns the result of calling the compareTo method on lowercased nicks. This is useful for sorting lists of User objects.

  Returns:
    the result of calling compareTo on lowercased nicks.

PircBot Java IRC Bot