Class Privacy


  • public final class Privacy
    extends Object
    The implementation of the the <query/> element in the jabber:iq:privacy namespace.

    This class contains information about the active and default list and holds the privacy lists.

    This class is immutable.

    See Also:
    XEP-0016: Privacy Lists, XML Schema
    • Constructor Detail

      • Privacy

        public Privacy()
        Creates an empty privacy element.
      • Privacy

        public Privacy​(PrivacyList... privacyLists)
        Creates a privacy element with one or more privacy lists.
        Parameters:
        privacyLists - The privacy list(s).
      • Privacy

        public Privacy​(String activeName,
                       String defaultName,
                       Collection<PrivacyList> privacyLists)
        Creates a privacy element with one or more privacy lists and an active and default name.
        Parameters:
        activeName - The active name.
        defaultName - The default name.
        privacyLists - The privacy list(s).
    • Method Detail

      • withActive

        public static Privacy withActive​(String active)
        Creates a privacy element with an active list.
        Parameters:
        active - The active list name. Pass an empty string if you want to decline the use of an active list.
        Returns:
        The privacy element.
      • withDefault

        public static Privacy withDefault​(String defaultName)
        Creates a privacy element with a default list.
        Parameters:
        defaultName - The default list name. Pass an empty string if you want to decline the use of a default list.
        Returns:
        The privacy element.
      • getActiveName

        public final String getActiveName()
        Gets the active list name.
        Returns:
        The active list name.
      • getDefaultName

        public final String getDefaultName()
        Sets the default list name.
        Returns:
        The default list name.
      • getPrivacyLists

        public final List<PrivacyList> getPrivacyLists()
        Gets the privacy lists.
        Returns:
        The privacy lists.