Class MucAdmin


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

    Usage

    
     // To create an element with an item of a role
     MucAdmin mucAdmin = MucAdmin.withItem(Role.MODERATOR);
     
    This class is immutable.
    See Also:
    XEP-0045: Multi-User Chat, XML Schema
    • Method Detail

      • withItem

        public static MucAdmin withItem​(Role role)
        Creates a <query/> element with an <item/> child element.

        Sample:

        
         <query xmlns='http://jabber.org/protocol/muc#admin'>
             <item role='participant'/>
         </query>
         
        Parameters:
        role - The role.
        Returns:
        The MucAdmin instance.
      • withItem

        public static MucAdmin withItem​(Affiliation affiliation)
        Creates a <query/> element with an <item/> child element.

        Sample:

        
         <query xmlns='http://jabber.org/protocol/muc#admin'>
             <item affiliation='outcast'/>
         </query>
         
        Parameters:
        affiliation - The affiliation.
        Returns:
        The MucAdmin instance.
      • withItem

        public static MucAdmin withItem​(Role role,
                                        String nick,
                                        String reason)
        Creates a <query/> element with an <item/> child element.

        Sample:

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

        public static MucAdmin withItem​(Affiliation affiliation,
                                        Jid jid,
                                        String reason)
        Creates a <query/> element with an <item/> child element.

        Sample:

        
         <query xmlns='http://jabber.org/protocol/muc#admin'>
             <item affiliation='outcast'
                   jid='earlofcambridge@shakespeare.lit'/>
         </query>
         
        Parameters:
        affiliation - The affiliation.
        jid - The JID.
        reason - The reason.
        Returns:
        The MucAdmin instance.
      • withItem

        public static MucAdmin withItem​(Affiliation affiliation,
                                        Jid jid,
                                        String nick,
                                        String reason)
        Creates a <query/> element with an <item/> child element.

        Sample:

        
         <query xmlns='http://jabber.org/protocol/muc#admin'>
             <item affiliation='member'
              jid='hag66@shakespeare.lit'
              nick='thirdwitch'>
             <reason>A worthy witch indeed!</reason>
         </query>
         
        Parameters:
        affiliation - The affiliation.
        jid - The JID.
        nick - The nick.
        reason - The reason.
        Returns:
        The MucAdmin instance.
      • withItems

        public static MucAdmin withItems​(List<Item> items)
        Creates a <query/> element with <item/> child elements.

        Sample:

        
         <query xmlns='http://jabber.org/protocol/muc#admin'>
             <item affiliation='none'
                   jid='polonius@hamlet/castle'
                   nick='Polo'
                   role='participant'/>
             <item affiliation='none'
                   jid='horatio@hamlet/castle'
                   nick='horotoro'
                   role='participant'/>
             <item affiliation='member'
                   jid='hecate@shakespeare.lit/broom'
                   nick='Hecate'
                   role='participant'/>
         </query>
         
        Parameters:
        items - The items.
        Returns:
        The MucAdmin instance.
      • withItems

        public static MucAdmin withItems​(Item... items)
        Creates a <query/> element with <item/> child elements.
        Parameters:
        items - The items.
        Returns:
        The MucAdmin instance.
        See Also:
        withItems(Item...)
      • createItem

        public static Item createItem​(Affiliation affiliation,
                                      Role role,
                                      Jid jid,
                                      String nick,
                                      Actor actor,
                                      String reason)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        affiliation - The affiliation.
        role - The role.
        jid - The JID.
        nick - The nick.
        actor - The actor.
        reason - The reason.
        Returns:
        The item.
      • createItem

        public static Item createItem​(Role role,
                                      String nick,
                                      String reason)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        role - The role.
        nick - The nick.
        reason - The reason.
        Returns:
        The item.
      • createItem

        public static Item createItem​(Role role,
                                      String nick)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        role - The role.
        nick - The nick.
        Returns:
        The item.
      • createItem

        public static Item createItem​(Role role)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        role - The role.
        Returns:
        The item.
      • createItem

        public static Item createItem​(Affiliation affiliation)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        affiliation - The affiliation.
        Returns:
        The item.
      • createItem

        public static Item createItem​(Affiliation affiliation,
                                      Jid jid)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        affiliation - The affiliation.
        jid - The JID.
        Returns:
        The item.
      • createItem

        public static Item createItem​(Affiliation affiliation,
                                      Jid jid,
                                      String reason)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        affiliation - The affiliation.
        jid - The JID.
        reason - The reason.
        Returns:
        The item.
      • createItem

        public static Item createItem​(Affiliation affiliation,
                                      Jid jid,
                                      String nick,
                                      String reason)
        Creates an item, which can be used as input parameter for withItems(Item...).
        Parameters:
        affiliation - The affiliation.
        jid - The JID.
        nick - The nick.
        reason - The reason.
        Returns:
        The item.
      • getItems

        public List<Item> getItems()
        Gets the items.
        Returns:
        The items.