JID¶
-
public final class
JIDimplements Comparable<JID>¶ The class defines an instance of a single XMPP JID identifier. When the object is created all parameters are checked and processed through the stringprep. An exception is thrown in case of a stringprep processing error. Created: Dec 28, 2009 10:48:04 PM
Author: Artur Hefczyc
Methods¶
compareTo¶
-
public int
compareTo(JID o)¶ Method compares the
JIDinstance with a given object. The implementation fulfills the specification contract and returns a value as you would expect from the call:jid_1.toString().compareTo(jid_2.toString())
Parameters: - o – is a
JIDinstance to compare to.
Returns: an integer value which is a result of comparing the two objects.
- o – is a
copyWithResource¶
-
public JID
copyWithResource(String resource)¶ The method returns a copy of the
JIDinstance with a different resource part given as a parameter.Parameters: - resource – is a
Stringinstance representing JID’s new resource part.
Throws: - TigaseStringprepException – if resource stringprep processing fails.
Returns: a new instance of the
JIDclass with a new resource part.- resource – is a
copyWithResourceNS¶
copyWithoutResource¶
equals¶
-
public boolean
equals(Object b)¶ Method compares whether this
JIDinstance represents the same user JID as the one given in parameter. It returnstrueof all: the localpart (nickname), domain part, and the resource part are the same for both objects.Parameters: - b – is a
JIDobject to which the instance is compared.
Returns: a
booleanvalue oftrueif both instances represent the same JID andfalseotherwise.- b – is a
getBareJID¶
getDomain¶
getLocalpart¶
getResource¶
hashCode¶
-
public int
hashCode()¶ Method returns a hash code calculated for the
JIDinstance.Returns: an object hash code.
jidInstance¶
-
public static JID
jidInstance(BareJID bareJid, String p_resource)¶ Constructs a new
JIDinstance using givenBareJIDinstance as user bare JID andStringinstance as a resource part. As theBareJIDinstances are immutable the constructor doesn’t create a copy of the givenBareJID, instead it saves the reference to a given object. The resource parameter is parsed, checked and run through the stringprep processing. In case of stringprep error, an exception is thrown.Parameters: - bareJid – is a
BareJIDinstance used to create theJIDinstance. - p_resource – is a
Stringinstance representing JID’s resource part.
Throws: - TigaseStringprepException – exception if there was an error during stringprep processing or null if passed string/domain was null or effectively empty..
Returns: JIDclass instance.- bareJid – is a
jidInstance¶
-
public static JID
jidInstance(BareJID bareJid)¶ Creates a new
JIDinstance using givenBareJIDinstance as a parameter. The resource part is set to null. As theBareJIDinstances are immutable the constructor doesn’t create a copy of the givenBareJID, instead it saves the reference to a given object.Parameters: - bareJid – is a
BareJIDinstance used to create theJIDinstance.
Returns: JIDclass instance.- bareJid – is a
jidInstance¶
-
public static JID
jidInstance(String jid)¶ Constructs a new
JIDinstance using a JID parameter given as aStringinstance. The parameter is parsed, checked and run through stringprep processing. An exception is thrown if there is an error while the JID is checked.Parameters: - jid – a JID parameter given as a
Stringinstance.
Throws: - TigaseStringprepException – exception if there was an error during stringprep processing or null if passed string/domain was null or effectively empty..
Returns: JIDclass instance.- jid – a JID parameter given as a
jidInstance¶
-
public static JID
jidInstance(String localpart, String domain)¶ Constructs a new
JIDinstance using givenStringparameters. All theStringparameters are parsed, checked and run through the stringprep processing. In case of stringprep error, an exception is thrown.Parameters: - localpart – is a
Stringinstance representing JID’s localpart (nickname) part. - domain – is a
Stringinstance representing JID’s domain part.
Throws: - TigaseStringprepException – exception if there was an error during stringprep processing or null if passed string/domain was null or effectively empty..
Returns: JIDclass instance.- localpart – is a
jidInstance¶
-
public static JID
jidInstance(String localpart, String domain, String resource)¶ Constructs a new
JIDinstance using givenStringparameters. All theStringparameters are parsed, checked and run through the stringprep processing. In case of stringprep error, an exception is thrown.Parameters: - localpart – is a
Stringinstance representing JID’s localpart (nickname) part. - domain – is a
Stringinstance representing JID’s domain part. - resource – is a
Stringinstance representing JID’s resource part.
Throws: - TigaseStringprepException – exception if there was an error during stringprep processing or if passed string/domain was null or effectively empty..
Returns: JIDclass instance.- localpart – is a
jidInstanceNS¶
-
public static JID
jidInstanceNS(BareJID bareJid)¶ Constructs a new
JIDinstance using givenBareJIDinstance as user bare JID andStringinstance as a resource part. Note, this method does not perform stringprep processing on input parameters. As theBareJIDinstances are immutable the constructor doesn’t create a copy of the givenBareJID, instead it saves the reference to a given object.Parameters: - bareJid – is a
BareJIDinstance used to create theJIDinstance.
Returns: JIDclass instance or null if passed string/domain was null or effectively empty.- bareJid – is a
jidInstanceNS¶
-
public static JID
jidInstanceNS(BareJID bareJid, String p_resource)¶ Constructs a new
JIDinstance using givenBareJIDinstance as user bare JID andStringinstance as a resource part. Note, this method does not perform stringprep processing on input parameters. As theBareJIDinstances are immutable the constructor doesn’t create a copy of the givenBareJID, instead it saves the reference to a given object.Parameters: - bareJid – is a
BareJIDinstance used to create theJIDinstance. - p_resource – is a
Stringinstance representing JID’s resource part.
Returns: JIDclass instance or null if passed string/domain was null or effectively empty.- bareJid – is a
jidInstanceNS¶
-
public static JID
jidInstanceNS(String jid)¶ Constructs a new
JIDinstance using a JID parameter given as aStringinstance. Note, this method does not perform stringprep processing on input parameters and it returns null if null is passed as parameter. The method does not throwNullPointerExceptionif theStringpassed is null.Parameters: - jid – a JID parameter given as a
Stringinstance.
Returns: JIDclass instance or null.- jid – a JID parameter given as a
jidInstanceNS¶
-
public static JID
jidInstanceNS(String localpart, String domain, String resource)¶ Constructs a new
JIDinstance using givenStringparameters. Note, this method does not perform stringprep processing on input parameters.Parameters: - localpart – is a
Stringinstance representing JID’s localpart (nickname) part. - domain – is a
Stringinstance representing JID’s domain part. - resource – is a
Stringinstance representing JID’s resource part.
Returns: JIDclass instance.- localpart – is a
jidInstanceNS¶
-
public static JID
jidInstanceNS(String localpart, String domain)¶ Constructs a new
JIDinstance using givenStringparameters. Note, this method does not perform stringprep processing on input parameters.Parameters: - localpart – is a
Stringinstance representing JID’s localpart (nickname) part. - domain – is a
Stringinstance representing JID’s domain part.
Returns: JIDclass instance.- localpart – is a