public class MessageSourceContact extends DataObject implements SourceContact, java.lang.Comparable<MessageSourceContact>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PAST_DATE_FORMAT
Date format used to mark past messages.
|
static java.lang.String |
TODAY_DATE_FORMAT
Date format used to mark today messages.
|
DATA_ID
Constructor and Description |
---|
MessageSourceContact(java.util.EventObject source,
MessageSourceService service)
Constructs MessageSourceContact.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MessageSourceContact o)
Compares two MessageSourceContacts.
|
boolean |
equals(java.lang.Object o) |
Contact |
getContact()
The contact.
|
java.lang.String |
getContactAddress()
Returns the address of the contact.
|
java.util.List<ContactDetail> |
getContactDetails()
Returns a list of available contact details.
|
java.util.List<ContactDetail> |
getContactDetails(java.lang.Class<? extends OperationSet> operationSet)
Returns a list of all ContactDetails supporting the given
OperationSet class.
|
java.util.List<ContactDetail> |
getContactDetails(ContactDetail.Category category)
Returns a list of all ContactDetails corresponding to the given
category.
|
ContactSourceService |
getContactSource()
Returns the parent ContactSourceService from which this contact
came from.
|
java.lang.String |
getDisplayDetails()
Returns the display details of this search contact.
|
java.lang.String |
getDisplayName()
Returns the display name of this search contact.
|
byte[] |
getImage()
An image (or avatar) corresponding to this search contact.
|
int |
getIndex()
Returns the index of this source contact in its parent.
|
ContactDetail |
getPreferredContactDetail(java.lang.Class<? extends OperationSet> operationSet)
Returns the preferred ContactDetail for a given
OperationSet class.
|
PresenceStatus |
getPresenceStatus()
Returns the status of the source contact.
|
ProtocolProviderService |
getProtocolProviderService()
The protocol provider.
|
ChatRoom |
getRoom()
The room.
|
java.util.Date |
getTimestamp()
The timestamp of the message.
|
int |
hashCode() |
(package private) void |
initDetails(boolean isChatRoom,
Contact contact)
We will the details for this source contact.
|
(package private) void |
initDetails(java.util.EventObject source)
Init details.
|
boolean |
isDefaultImage()
Whether the current image returned by @see #getImage() is the one
provided by the SourceContact by default, or is a one used and obtained
from external source.
|
void |
setContactAddress(java.lang.String contactAddress)
Sets the address of the contact.
|
void |
setDisplayName(java.lang.String displayName)
Changes display name.
|
void |
setStatus(PresenceStatus status)
Sets current status.
|
java.lang.String |
toString() |
(package private) void |
update(java.util.EventObject source)
Updates fields.
|
getData, setData
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getData, setData
public static final java.lang.String TODAY_DATE_FORMAT
public static final java.lang.String PAST_DATE_FORMAT
MessageSourceContact(java.util.EventObject source, MessageSourceService service)
source
- the source event.service
- the message source service.public ProtocolProviderService getProtocolProviderService()
void update(java.util.EventObject source)
source
- the event objectpublic java.lang.String toString()
toString
in class java.lang.Object
void initDetails(java.util.EventObject source)
source
- the source event.void initDetails(boolean isChatRoom, Contact contact)
isChatRoom
- is current source contact a chat room.public java.lang.String getDisplayName()
SourceContact
getDisplayName
in interface SourceContact
public java.lang.String getContactAddress()
SourceContact
getContactAddress
in interface SourceContact
public ContactSourceService getContactSource()
SourceContact
getContactSource
in interface SourceContact
public java.lang.String getDisplayDetails()
SourceContact
getDisplayDetails
in interface SourceContact
public java.util.List<ContactDetail> getContactDetails()
getContactDetails
in interface SourceContact
public java.util.List<ContactDetail> getContactDetails(java.lang.Class<? extends OperationSet> operationSet)
getContactDetails
in interface SourceContact
operationSet
- the OperationSet class we're looking forpublic java.util.List<ContactDetail> getContactDetails(ContactDetail.Category category) throws OperationNotSupportedException
getContactDetails
in interface SourceContact
category
- the OperationSet class we're looking forOperationNotSupportedException
- if categories aren't supported
for call history recordspublic ContactDetail getPreferredContactDetail(java.lang.Class<? extends OperationSet> operationSet)
getPreferredContactDetail
in interface SourceContact
operationSet
- the OperationSet class, for which we would
like to obtain a ContactDetailpublic byte[] getImage()
SourceContact
getImage
in interface SourceContact
public boolean isDefaultImage()
SourceContact
isDefaultImage
in interface SourceContact
public void setContactAddress(java.lang.String contactAddress)
SourceContact
setContactAddress
in interface SourceContact
contactAddress
- the address to set.public PresenceStatus getPresenceStatus()
SourceContact
getPresenceStatus
in interface SourceContact
public void setStatus(PresenceStatus status)
status
- public int getIndex()
SourceContact
getIndex
in interface SourceContact
public Contact getContact()
public ChatRoom getRoom()
public java.util.Date getTimestamp()
public void setDisplayName(java.lang.String displayName)
displayName
- public int compareTo(MessageSourceContact o)
compareTo
in interface java.lang.Comparable<MessageSourceContact>
o
- the object to compare withpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.