public class MockContact extends AbstractContact
Constructor and Description |
---|
MockContact(java.lang.String id,
MockProvider parentProvider)
Creates an instance of a meta contact with the specified string used
as a name and identifier.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Determines whether a specific Object is equal to this instance.
|
java.lang.String |
getAddress()
Returns a String that can be used for identifying the contact.
|
java.lang.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.
|
java.lang.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.
|
java.util.Collection<ContactResource> |
getResources()
Returns a collection of resources supported by this contact or null
if it doesn't support resources.
|
java.lang.String |
getStatusMessage()
Return the current status message of this contact.
|
int |
hashCode()
Returns a hash code value for this instance supported for the benefit of
hashtables.
|
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(java.lang.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 |
setPersistent(boolean isPersistent) |
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.
|
boolean |
supportResources()
Indicates if this contact supports resources.
|
java.lang.String |
toString()
Returns a string representation of this contact, containing most of its
representative details.
|
addResourceListener, fireContactResourceEvent, getPersistableAddress, isMobile, removeResourceListener
public MockContact(java.lang.String id, MockProvider parentProvider)
id
- the identifier of this contact (also used as a name).parentProvider
- the provider that created us.public boolean equals(java.lang.Object obj)
Contact.getAddress()
regardless of their ProtocolProviderService.equals
in class AbstractContact
obj
- the Object which is to be compared to this instancepublic java.lang.String getAddress()
public java.lang.String getDisplayName()
public byte[] getImage()
public ContactGroup getParentContactGroup()
public java.lang.String getPersistentData()
public PresenceStatus getPresenceStatus()
public ProtocolProviderService getProtocolProvider()
public java.lang.String getStatusMessage()
public int hashCode()
hashCode
in class AbstractContact
public boolean isLocal()
public boolean isPersistent()
public boolean isResolved()
public void setDisplayName(java.lang.String displayName)
displayName
- the new display name for this contact.void setParentGroup(MockContactGroup newParentGroup)
newParentGroup
- the MockContactGroup that is now parent
of this MockContactpublic void setPresenceStatus(MockStatusEnum mockPresenceStatus)
mockPresenceStatus
- the MockPresenceStatus currently valid
for this contact.public void setResolved(boolean resolved)
resolved
- true to make the contact resolved; false to
make it unresolvedpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean supportResources()
supportResources
in interface Contact
supportResources
in class AbstractContact
public java.util.Collection<ContactResource> getResources()
getResources
in interface Contact
getResources
in class AbstractContact
public void setPersistent(boolean isPersistent)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.