|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.protocol.mock.MockContact
public class MockContact
A simple, straightforward mock implementation of the Contact interface that can be manually created and used in testing a MetaContactList service
| Constructor Summary | |
|---|---|
MockContact(String id,
MockProvider parentProvider)
Creates an instance of a meta contact with the specified string used as a name and identifier. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one which in terms of contacts translates to having equal ids. |
String |
getAddress()
Returns a String that can be used for identifying the contact. |
String |
getDisplayName()
Returns a String that could be used by any user interacting modules for referring to this contact. |
byte[] |
getImage()
Returns a byte array containing an image (most often a photo or an avatar) that the contact uses as a representation. |
ContactGroup |
getParentContactGroup()
Returns the group that contains this contact. |
String |
getPersistentData()
Returns null as no persistent data is required and the contact address is sufficient for restoring the contact. |
PresenceStatus |
getPresenceStatus()
Returns the status of the contact. |
ProtocolProviderService |
getProtocolProvider()
Returns a reference to the protocol provider that created the contact. |
String |
getStatusMessage()
Return the current status message of this contact. |
boolean |
isLocal()
Determines whether or not this contact represents our own identity. |
boolean |
isPersistent()
Determines whether or not this contact is being stored by the server. |
boolean |
isResolved()
Determines whether or not this contact has been resolved against the server. |
void |
setDisplayName(String displayName)
Modify the display name of this contact. |
(package private) void |
setParentGroup(MockContactGroup newParentGroup)
This method is only called when the contact is added to a new MockContactGroup by the MockContactGroup itself. |
void |
setPresenceStatus(MockStatusEnum mockPresenceStatus)
Sets mockPresenceStatus as the PresenceStatus that this contact is currently in. |
void |
setResolved(boolean resolved)
Makes the contact resolved or unresolved. |
String |
toString()
Returns a string representation of this contact, containing most of its representative details. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MockContact(String id,
MockProvider parentProvider)
id - the identifier of this contact (also used as a name).parentProvider - the provider that created us.| Method Detail |
|---|
void setParentGroup(MockContactGroup newParentGroup)
newParentGroup - the MockContactGroup that is now parent
of this MockContactpublic String getAddress()
getAddress in interface Contactpublic String getDisplayName()
getDisplayName in interface Contactpublic void setDisplayName(String displayName)
displayName - the new display name for this contact.public byte[] getImage()
getImage in interface Contactpublic PresenceStatus getPresenceStatus()
getPresenceStatus in interface Contactpublic void setPresenceStatus(MockStatusEnum mockPresenceStatus)
mockPresenceStatus - the MockPresenceStatus currently valid
for this contact.public ProtocolProviderService getProtocolProvider()
getProtocolProvider in interface Contactpublic boolean isLocal()
public ContactGroup getParentContactGroup()
getParentContactGroup in interface Contactpublic String toString()
toString in class Objectpublic boolean isPersistent()
isPersistent in interface Contactpublic String getPersistentData()
getPersistentData in interface Contactpublic boolean isResolved()
isResolved in interface Contactpublic void setResolved(boolean resolved)
resolved - true to make the contact resolved; false to
make it unresolvedpublic boolean equals(Object obj)
equals in class Objectobj - the reference object with which to compare.
true if this contact has the same id as that of the
obj argument.public String getStatusMessage()
getStatusMessage in interface Contact
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||