public interface MetaContact extends java.lang.Comparable<MetaContact>
Instances of a MetaContact are read-only objects that cannot be modified directly but only through the corresponding MetaContactListService.
Modifier and Type | Method and Description |
---|---|
void |
addDetail(java.lang.String name,
java.lang.String value)
Adds a custom detail to this contact.
|
void |
changeDetail(java.lang.String name,
java.lang.String oldValue,
java.lang.String newValue)
Change the detail.
|
boolean |
containsContact(Contact protocolContact)
Returns true if the given protocolContact is contained
in this MetaContact, otherwise - returns false.
|
byte[] |
getAvatar()
Returns the avatar of this contact, that can be used when including this
MetaContact in user interface.
|
byte[] |
getAvatar(boolean isLazy)
Returns the avatar of this contact, that can be used when including this
MetaContact in user interface.
|
Contact |
getContact(java.lang.String contactAddress,
ProtocolProviderService ownerProvider)
Returns a contact encapsulated by this meta contact, having the specified
contactAddress and coming from the indicated ownerProvider.
|
int |
getContactCount()
Returns the number of protocol speciic Contacts that this
MetaContact contains.
|
java.util.Iterator<Contact> |
getContacts()
Returns a java.util.Iterator with all protocol specific
Contacts encapsulated by this MetaContact.
|
java.util.List<Contact> |
getContactsForOperationSet(java.lang.Class<? extends OperationSet> opSetClass)
Returns all protocol specific Contacts, encapsulated by this MetaContact
and supporting the given opSetClass.
|
java.util.Iterator<Contact> |
getContactsForProvider(ProtocolProviderService provider)
Returns all protocol specific Contacts, encapsulated by this MetaContact
and coming from the indicated ProtocolProviderService.
|
java.lang.Object |
getData(java.lang.Object key)
Gets the user data associated with this instance and a specific key.
|
Contact |
getDefaultContact()
Returns the default protocol specific Contact to use when
communicating with this MetaContact.
|
Contact |
getDefaultContact(java.lang.Class<? extends OperationSet> operationSet)
Returns the default protocol specific Contact to use with this
MetaContact for a precise operation (IM, call, ...).
|
java.util.List<java.lang.String> |
getDetails(java.lang.String name)
Get all details with given name.
|
java.lang.String |
getDisplayName()
Returns a characteristic display name that can be used when including
this MetaContact in user interface.
|
java.lang.String |
getMetaUID()
Returns a String identifier (the actual contents is left to
implementations) that uniquely represents this MetaContact
in the containing MetaContactList
|
MetaContactGroup |
getParentMetaContactGroup()
Returns the MetaContactGroup currently containing this meta contact
|
void |
removeDetail(java.lang.String name,
java.lang.String value)
Remove the given detail.
|
void |
removeDetails(java.lang.String name)
Remove all details with given name.
|
void |
setData(java.lang.Object key,
java.lang.Object value)
Sets a user-specific association in this instance in the form of a
key-value pair.
|
java.lang.String |
toString()
Returns a String representation of this MetaContact.
|
Contact getDefaultContact()
Contact getDefaultContact(java.lang.Class<? extends OperationSet> operationSet)
operationSet
- the operation for which the default contact is neededjava.util.Iterator<Contact> getContacts()
Note to implementors: In order to prevent problems with concurrency, the Iterator returned by this method should not be over the actual list of contacts but rather over a copy of that list.
Contact getContact(java.lang.String contactAddress, ProtocolProviderService ownerProvider)
contactAddress
- the address of the contact who we're looking for.ownerProvider
- a reference to the ProtocolProviderService that
the contact we're looking for belongs to.boolean containsContact(Contact protocolContact)
protocolContact
- the Contact we're looking forint getContactCount()
java.util.Iterator<Contact> getContactsForProvider(ProtocolProviderService provider)
Note to implementors: In order to prevent problems with concurrency, the Iterator returned by this method should not be over the actual list of contacts but rather over a copy of that list.
provider
- a reference to the ProtocolProviderService
whose contacts we'd like to get.java.util.List<Contact> getContactsForOperationSet(java.lang.Class<? extends OperationSet> opSetClass)
Note to implementors: In order to prevent problems with concurrency, the List returned by this method should not be the actual list of contacts but rather a copy of that list.
opSetClass
- the operation for which the default contact is neededMetaContactGroup getParentMetaContactGroup()
java.lang.String getMetaUID()
java.lang.String getDisplayName()
byte[] getAvatar()
byte[] getAvatar(boolean isLazy)
isLazy
- Indicates if this method should return the locally stored
avatar or it should obtain the avatar right from the server.java.lang.String toString()
toString
in class java.lang.Object
void addDetail(java.lang.String name, java.lang.String value)
name
- name of the detail.value
- the value of the detail.void removeDetail(java.lang.String name, java.lang.String value)
name
- of the detail to be removed.value
- value of the detail to be removed.void removeDetails(java.lang.String name)
name
- of the details to be removed.void changeDetail(java.lang.String name, java.lang.String oldValue, java.lang.String newValue)
name
- of the detail to be changed.oldValue
- the old value of the detail.newValue
- the new value of the detail.java.util.List<java.lang.String> getDetails(java.lang.String name)
name
- the name of the details we are searching.java.lang.Object getData(java.lang.Object key)
key
- the key of the user data associated with this instance to be
retrievedvoid setData(java.lang.Object key, java.lang.Object value)
The user-defined association created by this method and stored in this instance is not serialized by this instance and is thus only meant for runtime use.
The storage of the user data is implementation-specific and is thus not guaranteed to be optimized for execution time and memory use.
key
- the key to associate in this instance with the specified valuevalue
- the value to be associated in this instance with the
specified key
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.