tigase.muc.xmpp
Class JID

java.lang.Object
  extended by tigase.muc.xmpp.JID
All Implemented Interfaces:
java.io.Serializable

public class JID
extends java.lang.Object
implements java.io.Serializable

Represents a Jabber ID (JID) object.

Created: 2005-01-18 19:58:39

Version:
$Rev: 81 $
Author:
bmalkow
See Also:
Serialized Form

Constructor Summary
JID(java.lang.String username, java.lang.String host)
          Creates a new JID object with empty resource.
JID(java.lang.String username, java.lang.String host, java.lang.String resource)
          Creates a new JID object.
 
Method Summary
 boolean equals(java.lang.Object other)
          
static JID fromString(java.lang.String jid)
          This method creates JID object from a String.
 JID getBareJID()
          Return a bare JID.
 java.lang.String getHost()
          Returns the host name if was specified, otherwise null.
 java.lang.String getResource()
          Returns the resource if was specified, otherwise null.
 java.lang.String getUsername()
          Returns the username if was specified, otherwise null.
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JID

public JID(java.lang.String username,
           java.lang.String host)
Creates a new JID object with empty resource.

Parameters:
username - String holding username or null
host - String holding host name or null

JID

public JID(java.lang.String username,
           java.lang.String host,
           java.lang.String resource)
Creates a new JID object.

Parameters:
username - String holding username or null
host - String holding host name or null
resource - String holding resource or null
Method Detail

fromString

public static JID fromString(java.lang.String jid)
This method creates JID object from a String.

Parameters:
jid - String value holding JID
Returns:
JID object if jid is correct.

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

getBareJID

public JID getBareJID()
Return a bare JID. Without roesource name.

Returns:
bare JID

getHost

public java.lang.String getHost()
Returns the host name if was specified, otherwise null.

Returns:
String holding the host name.

getResource

public java.lang.String getResource()
Returns the resource if was specified, otherwise null.

Returns:
String holding the resource.

getUsername

public java.lang.String getUsername()
Returns the username if was specified, otherwise null.

Returns:
String holding the username.

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2007 Tigase. All Rights Reserved.