Class Privacy
- java.lang.Object
-
- rocks.xmpp.extensions.privacy.model.Privacy
-
public final class Privacy extends Object
The implementation of the the<query/>element in thejabber:iq:privacynamespace.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 Summary
Constructors Constructor Description Privacy()Creates an empty privacy element.Privacy(String activeName, String defaultName, Collection<PrivacyList> privacyLists)Creates a privacy element with one or more privacy lists and an active and default name.Privacy(PrivacyList... privacyLists)Creates a privacy element with one or more privacy lists.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetActiveName()Gets the active list name.StringgetDefaultName()Sets the default list name.List<PrivacyList>getPrivacyLists()Gets the privacy lists.StringtoString()static PrivacywithActive(String active)Creates a privacy element with an active list.static PrivacywithDefault(String defaultName)Creates a privacy element with a default list.
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
jabber:iq:privacy- See Also:
- Constant Field Values
-
-
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.
-
-