Class MucUser


  • public final class MucUser
    extends Object
    The implementation of the <x/> element in the http://jabber.org/protocol/muc#user namespace.

    Usage

    
     // To create an element with an item of 'owner' and 'moderator'
     MucUser mucUser = MucUser.withItem(Affiliation.OWNER, Role.MODERATOR);
     
    This class is immutable.
    See Also:
    XEP-0045: Multi-User Chat, XML Schema
    • Method Detail

      • withItem

        public static MucUser withItem​(Affiliation affiliation,
                                       Role role,
                                       Status... status)
        Creates a <x/> element with an <item/> and a <status/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='owner' role='moderator'/>
             <status code='110'/>
         </x>
         
        Parameters:
        affiliation - The affiliation.
        role - The role.
        status - The status.
        Returns:
        The MucUser instance.
      • withItem

        public static MucUser withItem​(Affiliation affiliation,
                                       Role role,
                                       Jid jid,
                                       Status... status)
        Creates a <x/> element with an <item/> and a <status/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='none'
                   jid='hag66@shakespeare.lit/pda'
                   role='participant'/>
         </x>
         
        Parameters:
        affiliation - The affiliation.
        role - The role.
        jid - The JID.
        status - The status.
        Returns:
        The MucUser instance.
      • withItem

        public static MucUser withItem​(Affiliation affiliation,
                                       Role role,
                                       Jid jid,
                                       String nick,
                                       Status... status)
        Creates a <x/> element with an <item/> and a <status/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='member'
                   jid='hag66@shakespeare.lit/pda'
                   nick='oldhag'
                   role='participant'/>
             <status code='303'/>
         </x>
         
        Parameters:
        affiliation - The affiliation.
        role - The role.
        jid - The JID.
        nick - The nick.
        status - The status.
        Returns:
        The MucUser instance.
      • withItem

        public static MucUser withItem​(Role role,
                                       String nick,
                                       String reason,
                                       Status... status)
        Creates a <x/> element with an <item/> and a <status/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='member'
                   jid='hag66@shakespeare.lit/pda'
                   nick='oldhag'
                   role='participant'/>
             <status code='303'/>
         </x>
         
        Parameters:
        role - The role.
        nick - The nick.
        reason - The reason.
        status - The status.
        Returns:
        The MucUser instance.
      • withItem

        public static MucUser withItem​(Affiliation affiliation,
                                       Role role,
                                       Actor actor,
                                       String reason,
                                       Status... status)
        Creates a <x/> element with an <item/> and a <status/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='none' role='none'>
                 <actor nick='Fluellen'/>
                 <reason>Avaunt, you cullion!</reason>
             </item>
             <status code='307'/>
         </x>
         
        Parameters:
        affiliation - The affiliation.
        role - The role.
        actor - The actor.
        reason - The reason.
        status - The status.
        Returns:
        The MucUser instance.
      • withItem

        public static MucUser withItem​(Affiliation affiliation,
                                       Role role,
                                       String nick,
                                       String reason)
        Creates a <x/> element with an <item/> and a <status/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='member'
                   nick='thirdwitch'
                   role='participant'>
                 <reason>A worthy witch indeed!</reason>
             </item>
         </x>
         
        Parameters:
        affiliation - The affiliation.
        role - The role.
        nick - The nick.
        reason - The reason.
        Returns:
        The MucUser instance.
      • withItem

        public static MucUser withItem​(Affiliation affiliation,
                                       Role role,
                                       Jid jid,
                                       String nick,
                                       Actor actor,
                                       String reason,
                                       Status... status)
        Creates a <x/> element with an <item/> and a <status/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='none' role='none' jid='hag66@shakespeare.lit/pda' nick='oldhag'>
                 <actor nick='Fluellen'/>
                 <reason>Avaunt, you cullion!</reason>
             </item>
             <status code='307'/>
         </x>
         
        Parameters:
        affiliation - The affiliation.
        role - The role.
        jid - The JID.
        nick - The nick.
        actor - The actor.
        reason - The reason.
        status - The status.
        Returns:
        The MucUser instance.
      • withDestroy

        public static MucUser withDestroy​(Affiliation affiliation,
                                          Role role,
                                          Jid jid,
                                          String reason)
        Creates a <x/> element with an <item/> and a <destroy/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <item affiliation='none' role='none'/>
             <destroy jid='coven@chat.shakespeare.lit'>
                 <reason>Macbeth doth come.</reason>
             </destroy>
         </x>
         
        Parameters:
        affiliation - The affiliation.
        role - The role.
        jid - The JID.
        reason - The reason.
        Returns:
        The MucUser instance.
      • withInvites

        public static MucUser withInvites​(Invite... invite)
        Creates a <x/> element with an <invite/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <invite to='hecate@shakespeare.lit'/>
         </x>
         
        Parameters:
        invite - The invites.
        Returns:
        The MucUser instance.
      • withInvite

        public static MucUser withInvite​(String password,
                                         Invite... invite)
        Creates a <x/> element with an <invite/> and a <password/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <invite to='hecate@shakespeare.lit'/>
             <password>cauldronburn</password>
         </x>
         
        Parameters:
        password - The password.
        invite - The invites.
        Returns:
        The MucUser instance.
      • withDecline

        public static MucUser withDecline​(Jid to,
                                          String reason)
        Creates a <x/> element with a <decline/> child element.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <decline to='crone1@shakespeare.lit'>
                 <reason>
                     Sorry, I'm too busy right now.
                 </reason>
             </decline>
         </x>
         
        Parameters:
        to - The to attribute.
        reason - The reason.
        Returns:
        The MucUser instance.
      • withStatus

        public static MucUser withStatus​(Status... status)
        Creates a <x/> element with one or more <status/> child elements.

        Sample:

        
         <x xmlns='http://jabber.org/protocol/muc#user'>
             <status code='170'/>
         </x>
         
        Parameters:
        status - The status.
        Returns:
        The MucUser instance.
      • getStatusCodes

        public Set<Status> getStatusCodes()
        Gets the status codes.
        Returns:
        The status codes.
      • getItem

        public Item getItem()
        Gets the item.
        Returns:
        The item.
      • getInvites

        public List<Invite> getInvites()
        Gets the invites
        Returns:
        The invites.
      • getDecline

        public Decline getDecline()
        Gets the decline.
        Returns:
        The decline.
      • getDestroy

        public Destroy getDestroy()
        Gets the destroy element.
        Returns:
        The destroy element.
      • getPassword

        public String getPassword()
        Gets the password for the room.
        Returns:
        The password for the room.