JSJaC

## Class JSJaCJID

    Object
       |
       +--JSJaCJID

class JSJaCJID

JSJaCJID models xmpp jid objects
Defined in JSJaCJID.js

Constructor Summary
`JSJaCJID(<Object> jid)` Creates a new JSJaCJID object

Method Summary
`JSJaCJID` | `clone()` creates a copy of this JSJaCJID object
`String` | `getDomain()` Gets the domain part of the jid
`String` | `getNode()` Gets the node part of the jid
`String` | `getResource()` Gets the resource part of the jid
`Boolean` | `isEntity(<String> jid)` Compares two jids if they belong to the same entity (i.e.
`JSJaCJID` | `removeResource()` Removes the resource part of the jid
`JSJaCJID` | `setDomain(<String> domain)` Sets the domain part of the jid
`JSJaCJID` | `setNode(<String> node)` Sets the node part of the jid
`JSJaCJID` | `setResource(<String> resource)` Sets the resource part of the jid
`String` | `toString()` The string representation of the full jid

Constructor Detail

### JSJaCJID

    JSJaCJID(<Object> jid)

Creates a new JSJaCJID object

Parameters:

`jid` - jid may be either of type String or a JID represented by JSON with fields 'node', 'domain' and 'resource'

Returns:

a new JSJaCJID object

Throws:

- JSJaCJIDInvalidException Thrown if jid is not valid

Method Detail

### clone

    JSJaCJID clone()

creates a copy of this JSJaCJID object

Returns:

A copy of this

### getDomain

    String getDomain()

Gets the domain part of the jid

Returns:

A string representing the domain name

### getNode

    String getNode()

Gets the node part of the jid

Returns:

A string representing the node name

### getResource

    String getResource()

Gets the resource part of the jid

Returns:

A string representing the resource

### isEntity

    Boolean isEntity(<String> jid)

Compares two jids if they belong to the same entity (i.e. w/o resource)

Parameters:

`jid` - a jid as string or JSJaCJID object

Returns:

'true' if jid is same entity as this

### removeResource

    JSJaCJID removeResource()

Removes the resource part of the jid

Returns:

This object

### setDomain

    JSJaCJID setDomain(<String> domain)

Sets the domain part of the jid

Parameters:

`domain` - Name of the domain

Returns:

This object

Throws:

- JSJaCJIDInvalidException Thrown if domain name contains invalid chars or is empty

### setNode

    JSJaCJID setNode(<String> node)

Sets the node part of the jid

Parameters:

`node` - Name of the node

Returns:

This object

Throws:

- JSJaCJIDInvalidException Thrown if node name contains invalid chars

### setResource

    JSJaCJID setResource(<String> resource)

Sets the resource part of the jid

Parameters:

`resource` - Name of the resource

Returns:

This object

### toString

    String toString()

The string representation of the full jid

Returns:

A string representing the jid

JSJaC

Documentation generated by JSDoc on Tue Jan 5 02:48:26 2021