com.beem.project.beem.service
Class Contact

Package class diagram package Contact
java.lang.Object
  extended by com.beem.project.beem.service.Contact
All Implemented Interfaces:
Parcelable

public class Contact
extends Object
implements Parcelable

This class contains informations on a jabber contact.


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.Creator<T>
 
Field Summary
static Parcelable.Creator<Contact> CREATOR
          Parcelable.Creator needs by Android.
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
Contact(String jid)
          Constructor.
Contact(Uri uri)
          Create a contact from a Uri.
 
Method Summary
 void addGroup(String group)
          Add a group for the contact.
 void addRes(String res)
          Add a resource for this contact.
 void delGroup(String group)
          Remove the contact from a group.
 void delRes(String res)
          Delete a resource for this contact.
 int describeContents()
          
 boolean equals(Object other)
           
 String getAvatarId()
          Get the avatar id of the contact.
 List<String> getGroups()
          Get the groups the contact is in.
 int getID()
          Get the id of the contact on the phone contact list.
 String getJID()
          Get the Jabber ID of the contact.
 String getJIDWithRes()
          Get a JID to access the specific contact on this resource.
 List<String> getMRes()
          Get the list of resource for the contact.
 String getMsgState()
          Get the message status of the contact.
 String getName()
          Get the name of the contact.
 String getSelectedRes()
          Get selected resource.
 int getStatus()
          Get the status of the contact.
 int hashCode()
           
static Uri makeXmppUri(String jid)
          Make an xmpp uri for a spcific jid.
 void setAvatarId(String avatarId)
          Set the avatar id of the contact.
 void setGroups(Collection<RosterGroup> groups)
          Set the groups the contact is in.
 void setGroups(List<String> groups)
          Set the groups the contact is in.
 void setID(int mid)
          set the id of te contact on the phone contact list.
 void setMRes(List<String> mRes)
          Set a list of resource for the contact.
 void setMsgState(String msgState)
          Set the message status of the contact.
 void setName(String name)
          Set the name of the contact.
 void setSelectedRes(String resource)
          Set the resource of the contact.
 void setStatus(int status)
          Set the status of the contact.
 void setStatus(Presence presence)
          Set the status of the contact using a presence packet.
 void setStatus(PresenceAdapter presence)
          Set status for the contact.
 String toString()
          
 Uri toUri()
          Get a URI to access the contact.
 Uri toUri(String resource)
          Get a URI to access the specific contact on this resource.
 void writeToParcel(Parcel dest, int flags)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATOR

public static final Parcelable.Creator<Contact> CREATOR
Parcelable.Creator needs by Android.

Constructor Detail

Contact

public Contact(String jid)
Constructor.

Parameters:
jid - JID of the contact

Contact

public Contact(Uri uri)
Create a contact from a Uri.

Parameters:
uri - an uri for the contact
Throws:
IllegalArgumentException - if it is not a xmpp uri
Method Detail

makeXmppUri

public static Uri makeXmppUri(String jid)
Make an xmpp uri for a spcific jid.

Parameters:
jid - the jid to represent as an uri
Returns:
an uri representing this jid.

writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)

Specified by:
writeToParcel in interface Parcelable

addGroup

public void addGroup(String group)
Add a group for the contact.

Parameters:
group - the group

delGroup

public void delGroup(String group)
Remove the contact from a group.

Parameters:
group - the group to delete the contact from.

addRes

public void addRes(String res)
Add a resource for this contact.

Parameters:
res - the resource to add

delRes

public void delRes(String res)
Delete a resource for this contact.

Parameters:
res - the resource de delete

describeContents

public int describeContents()

Specified by:
describeContents in interface Parcelable

getGroups

public List<String> getGroups()
Get the groups the contact is in.

Returns:
the mGroups

getID

public int getID()
Get the id of the contact on the phone contact list.

Returns:
the mID

getJID

public String getJID()
Get the Jabber ID of the contact.

Returns:
the Jabber ID

getSelectedRes

public String getSelectedRes()
Get selected resource.

Returns:
the selected resource.

getMRes

public List<String> getMRes()
Get the list of resource for the contact.

Returns:
the mRes

getMsgState

public String getMsgState()
Get the message status of the contact.

Returns:
the message status of the contact.

getName

public String getName()
Get the name of the contact.

Returns:
the mName

getStatus

public int getStatus()
Get the status of the contact.

Returns:
the mStatus

getAvatarId

public String getAvatarId()
Get the avatar id of the contact.

Returns:
the avatar id or null if there is not

setGroups

public void setGroups(Collection<RosterGroup> groups)
Set the groups the contact is in.

Parameters:
groups - list of groups

setGroups

public void setGroups(List<String> groups)
Set the groups the contact is in.

Parameters:
groups - the mGroups to set

setID

public void setID(int mid)
set the id of te contact on the phone contact list.

Parameters:
mid - the mID to set

setAvatarId

public void setAvatarId(String avatarId)
Set the avatar id of the contact.

Parameters:
avatarId - the avatar id

setSelectedRes

public void setSelectedRes(String resource)
Set the resource of the contact.

Parameters:
resource - to set.

setMRes

public void setMRes(List<String> mRes)
Set a list of resource for the contact.

Parameters:
mRes - the mRes to set

setMsgState

public void setMsgState(String msgState)
Set the message status of the contact.

Parameters:
msgState - the message status of the contact to set

setName

public void setName(String name)
Set the name of the contact.

Parameters:
name - the mName to set

setStatus

public void setStatus(int status)
Set the status of the contact.

Parameters:
status - the mStatus to set

setStatus

public void setStatus(Presence presence)
Set the status of the contact using a presence packet.

Parameters:
presence - the presence containing status

setStatus

public void setStatus(PresenceAdapter presence)
Set status for the contact.

Parameters:
presence - The presence packet which contains the status

toString

public String toString()

Overrides:
toString in class Object

toUri

public Uri toUri()
Get a URI to access the contact.

Returns:
the URI

toUri

public Uri toUri(String resource)
Get a URI to access the specific contact on this resource.

Parameters:
resource - the resource of the contact
Returns:
the URI

getJIDWithRes

public String getJIDWithRes()
Get a JID to access the specific contact on this resource.

Returns:
the JID.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009 Beem-project.com. All Rights Reserved.