Smack

org.jivesoftware.smack.packet
Class PrivacyItem.PrivacyRule

java.lang.Object
  extended by org.jivesoftware.smack.packet.PrivacyItem.PrivacyRule
Enclosing class:
PrivacyItem

public static class PrivacyItem.PrivacyRule
extends java.lang.Object

Privacy Rule represents the kind of action to apply. It holds the kind of communication ([jid|group|subscription]) it will allow or block and identifier to apply the action.


Field Summary
static java.lang.String SUBSCRIPTION_BOTH
          If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", "from", or "none"
static java.lang.String SUBSCRIPTION_FROM
           
static java.lang.String SUBSCRIPTION_NONE
           
static java.lang.String SUBSCRIPTION_TO
           
 
Constructor Summary
PrivacyItem.PrivacyRule()
           
 
Method Summary
protected static PrivacyItem.PrivacyRule fromString(java.lang.String value)
          Returns the type constant associated with the String value.
 PrivacyItem.Type getType()
          Returns the type hold the kind of communication it will allow or block.
 java.lang.String getValue()
          Returns the element identifier to apply the action.
 boolean isSuscription()
          Returns if the receiver represents a subscription rule.
protected  void setValue(java.lang.String value)
          Sets the element identifier to apply the action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBSCRIPTION_BOTH

public static final java.lang.String SUBSCRIPTION_BOTH
If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", "from", or "none"

See Also:
Constant Field Values

SUBSCRIPTION_TO

public static final java.lang.String SUBSCRIPTION_TO
See Also:
Constant Field Values

SUBSCRIPTION_FROM

public static final java.lang.String SUBSCRIPTION_FROM
See Also:
Constant Field Values

SUBSCRIPTION_NONE

public static final java.lang.String SUBSCRIPTION_NONE
See Also:
Constant Field Values
Constructor Detail

PrivacyItem.PrivacyRule

public PrivacyItem.PrivacyRule()
Method Detail

fromString

protected static PrivacyItem.PrivacyRule fromString(java.lang.String value)
Returns the type constant associated with the String value.


getType

public PrivacyItem.Type getType()
Returns the type hold the kind of communication it will allow or block. It MUST be filled with one of these values: jid, group or subscription.

Returns:
the type of communication it represent.

getValue

public java.lang.String getValue()
Returns the element identifier to apply the action. If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. If the type is "group", then the 'value' attribute SHOULD contain the name of a group in the user's roster. If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", "from", or "none".

Returns:
the identifier to apply the action.

setValue

protected void setValue(java.lang.String value)
Sets the element identifier to apply the action. If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. If the type is "group", then the 'value' attribute SHOULD contain the name of a group in the user's roster. If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", "from", or "none".

Parameters:
value - is the identifier to apply the action.

isSuscription

public boolean isSuscription()
Returns if the receiver represents a subscription rule.

Returns:
if the receiver represents a subscription rule.

Smack

Copyright © 2003-2007 Jive Software.