org.jabber.jabberbeans
Class RosterItemBuilder

java.lang.Object
  |
  +--org.jabber.jabberbeans.RosterItemBuilder

public class RosterItemBuilder
extends java.lang.Object
implements java.io.Serializable

RosterItemBuilder is used in the creation of a roster item.

Version:
$Revision: 1.1.1.1 $
Author:
David Waite <dwaite@jabber.com>, $Author: lucky $
See Also:
Serialized Form

Field Summary
private  java.lang.String askStateType
          The Asking State as described above
private  java.lang.String friendlyName
          The 'Friendly Name' as described above
private  java.util.Vector groups
          A vector of groups associated with this item, as described above
private  JID jid
          The JID as described above
private  java.lang.String subscriptionType
          The Subscription Type as described above
 
Constructor Summary
RosterItemBuilder()
          Creates a new RosterItemBuilder instance.
 
Method Summary
 void addGroup(java.lang.String groupName)
          addGroup adds a group name (string) to the groups list for this item.
 RosterItem build()
          build creates a roster item based on this builder's state
 void copyItem(RosterItem ri)
          copyItem copies information from an existing roster item.
 java.lang.String getFriendlyName()
          getFriendlyName returns the friendly name, if one exists
 java.util.Vector getGroups()
          getGroups returns a vector of the groups currently registered
 JID getJID()
          getJID returns the currently set JID.
 java.lang.String getSubscriptionType()
          getSubscriptionType returns the specified subscription type, if any
 java.lang.String getWaitingStateType()
          getWaitingStateType returns the waiting subscription request, if any
 void reset()
          reset restores the default values so that the builder can be reused.
 void setFriendlyName(java.lang.String friendlyName)
          setFriendlyName sets the friendly name
 void setJID(JID jid)
          setJID sets the current JID.
 void setSubscriptionType(java.lang.String subscriptionType)
          setSubscriptionType sets the subscription type - note that a client cannot alter this value through the roster interface.
 void setWaitingStateType(java.lang.String type)
          setWaitingStateType sets the waiting subscription request.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

jid

private JID jid
The JID as described above

subscriptionType

private java.lang.String subscriptionType
The Subscription Type as described above

askStateType

private java.lang.String askStateType
The Asking State as described above

friendlyName

private java.lang.String friendlyName
The 'Friendly Name' as described above

groups

private java.util.Vector groups
A vector of groups associated with this item, as described above
Constructor Detail

RosterItemBuilder

public RosterItemBuilder()
Creates a new RosterItemBuilder instance.
Method Detail

reset

public void reset()
reset restores the default values so that the builder can be reused.

getJID

public JID getJID()
getJID returns the currently set JID.
Returns:
a JID

setJID

public void setJID(JID jid)
setJID sets the current JID.
Parameters:
jid - a JID value

getSubscriptionType

public java.lang.String getSubscriptionType()
getSubscriptionType returns the specified subscription type, if any
Returns:
a String value, or null if not specified.

setSubscriptionType

public void setSubscriptionType(java.lang.String subscriptionType)
setSubscriptionType sets the subscription type - note that a client cannot alter this value through the roster interface.
Parameters:
subscriptionType - a String value, or null to clear

getWaitingStateType

public java.lang.String getWaitingStateType()
getWaitingStateType returns the waiting subscription request, if any
Returns:
a String value, or null if none

setWaitingStateType

public void setWaitingStateType(java.lang.String type)
setWaitingStateType sets the waiting subscription request. note that clients cannot change this value through this interface.
Parameters:
type - a String value, or null to clear.

getFriendlyName

public java.lang.String getFriendlyName()
getFriendlyName returns the friendly name, if one exists
Returns:
a String value, or null if none

setFriendlyName

public void setFriendlyName(java.lang.String friendlyName)
setFriendlyName sets the friendly name
Parameters:
friendlyName - a String value, or null to clear.

getGroups

public java.util.Vector getGroups()
getGroups returns a vector of the groups currently registered
Returns:
a Vector value

addGroup

public void addGroup(java.lang.String groupName)
addGroup adds a group name (string) to the groups list for this item.
Parameters:
groupName - a String value

copyItem

public void copyItem(RosterItem ri)
copyItem copies information from an existing roster item.
Parameters:
ri - a RosterItem to copy.

build

public RosterItem build()
                 throws java.lang.InstantiationException
build creates a roster item based on this builder's state
Returns:
a RosterItem value
Throws:
java.lang.InstantiationException - if insufficient or malformed data was specified.