Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.mock
Class MockChatRoomMember

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.mock.MockChatRoomMember
All Implemented Interfaces:
ChatRoomMember

public class MockChatRoomMember
extends Object
implements ChatRoomMember

Author:
Damian Minkov

Constructor Summary
MockChatRoomMember(String name, ChatRoom chatRoom, ChatRoomMemberRole role, Contact contact, byte[] avatar)
          Creates an instance of MockChatRoomMember by specifying the name of the member, the chatRoom, to which it belongs, its role in the room, the contact corresponding to it and its avatar.
 
Method Summary
 byte[] getAvatar()
          Returns the avatar of this member, that can be used when including it in user interface.
 ChatRoom getChatRoom()
          Returns the chat room that this member is participating in.
 Contact getContact()
          Returns the protocol contact corresponding to this member in our contact list.
 String getContactAddress()
          Returns the contact identifier representing this contact.
 String getName()
          Returns the name of this member as it is known in its containing chatroom (aka a nickname).
 ProtocolProviderService getProtocolProvider()
          Returns the protocol provider instance that this member has originated in.
 ChatRoomMemberRole getRole()
          Returns the role of this chat room member in its containing room.
 void setRole(ChatRoomMemberRole role)
          Sets the role of this member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockChatRoomMember

public MockChatRoomMember(String name,
                          ChatRoom chatRoom,
                          ChatRoomMemberRole role,
                          Contact contact,
                          byte[] avatar)
Creates an instance of MockChatRoomMember by specifying the name of the member, the chatRoom, to which it belongs, its role in the room, the contact corresponding to it and its avatar.

Parameters:
name - the name of the member
chatRoom - the chat room to which the member belongs
role - the role of the member in the room
contact - the contact corresponding to this member in the local contact list
avatar - the avatar of the member
Method Detail

getChatRoom

public ChatRoom getChatRoom()
Returns the chat room that this member is participating in.

Specified by:
getChatRoom in interface ChatRoomMember
Returns:
the ChatRoom instance that this member belongs to.

getProtocolProvider

public ProtocolProviderService getProtocolProvider()
Returns the protocol provider instance that this member has originated in.

Specified by:
getProtocolProvider in interface ChatRoomMember
Returns:
the ProtocolProviderService instance that created this member and its containing cht room

getContactAddress

public String getContactAddress()
Returns the contact identifier representing this contact. In protocols like IRC this method would return the same as getName() but in others like Jabber, this method would return a full contact id uri.

Specified by:
getContactAddress in interface ChatRoomMember
Returns:
a String (contact address), uniquely representing the contact over the service the service being used by the associated protocol provider instance/

getName

public String getName()
Returns the name of this member as it is known in its containing chatroom (aka a nickname). The name returned by this method, may sometimes match the string returned by getContactID() which is actually the address of a contact in the realm of the corresponding protocol.

Specified by:
getName in interface ChatRoomMember
Returns:
the name of this member as it is known in the containing chat room (aka a nickname).

getRole

public ChatRoomMemberRole getRole()
Returns the role of this chat room member in its containing room.

Specified by:
getRole in interface ChatRoomMember
Returns:
a ChatRoomMemberRole instance indicating the role the this member in its containing chat room.

setRole

public void setRole(ChatRoomMemberRole role)
Sets the role of this member.

Specified by:
setRole in interface ChatRoomMember
Parameters:
role - the role to set

getAvatar

public byte[] getAvatar()
Returns the avatar of this member, that can be used when including it in user interface.

Specified by:
getAvatar in interface ChatRoomMember
Returns:
an avatar (e.g. user photo) of this member.

getContact

public Contact getContact()
Returns the protocol contact corresponding to this member in our contact list.

Specified by:
getContact in interface ChatRoomMember
Returns:
the protocol contact corresponding to this member in our contact list.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.