Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.contactsource
Class GenericSourceContact

java.lang.Object
  extended by net.java.sip.communicator.service.contactsource.GenericSourceContact
All Implemented Interfaces:
SourceContact

public class GenericSourceContact
extends Object
implements SourceContact

Implements a generic SourceContact for the purposes of the support for the OS-specific Address Book.

Author:
Lyubomir Marinov

Constructor Summary
GenericSourceContact(ContactSourceService contactSource, String displayName, List<ContactDetail> contactDetails)
          Initializes a new AddrBookSourceContact instance.
 
Method Summary
 List<ContactDetail> getContactDetails()
          Gets the ContactDetails of this SourceContact.
 List<ContactDetail> getContactDetails(Class<? extends OperationSet> operationSet)
          Gets the ContactDetails of this SourceContact which support a specific OperationSet.
 List<ContactDetail> getContactDetails(String category)
          Returns a list of all ContactDetails corresponding to the given category.
 ContactSourceService getContactSource()
          Gets the ContactSourceService which has created this SourceContact.
 String getDisplayDetails()
          Gets the display details of this SourceContact.
 String getDisplayName()
          Gets the display name of this SourceContact.
 byte[] getImage()
          Gets the image/avatar of this SourceContact.
 ContactDetail getPreferredContactDetail(Class<? extends OperationSet> operationSet)
          Gets the preferred ContactDetail for a specific OperationSet.
 void setImage(byte[] image)
          Sets the image/avatar of this SourceContact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericSourceContact

public GenericSourceContact(ContactSourceService contactSource,
                            String displayName,
                            List<ContactDetail> contactDetails)
Initializes a new AddrBookSourceContact instance.

Parameters:
contactSource - the ContactSourceService which is creating the new instance
displayName - the display name of the new instance
contactDetails - the ContactDetails of the new instance
Method Detail

getContactDetails

public List<ContactDetail> getContactDetails()
Gets the ContactDetails of this SourceContact.

Specified by:
getContactDetails in interface SourceContact
Returns:
the ContactDetails of this SourceContact
See Also:
SourceContact.getContactDetails()

getContactDetails

public List<ContactDetail> getContactDetails(Class<? extends OperationSet> operationSet)
Gets the ContactDetails of this SourceContact which support a specific OperationSet.

Specified by:
getContactDetails in interface SourceContact
Parameters:
operationSet - the OperationSet the supporting ContactDetails of which are to be returned
Returns:
the ContactDetails of this SourceContact which support the specified operationSet
See Also:
SourceContact.getContactDetails(Class)

getContactDetails

public List<ContactDetail> getContactDetails(String category)
Returns a list of all ContactDetails corresponding to the given category.

Specified by:
getContactDetails in interface SourceContact
Parameters:
category - the OperationSet class we're looking for
Returns:
a list of all ContactDetails corresponding to the given category

getContactSource

public ContactSourceService getContactSource()
Gets the ContactSourceService which has created this SourceContact.

Specified by:
getContactSource in interface SourceContact
Returns:
the ContactSourceService which has created this SourceContact
See Also:
SourceContact.getContactSource()

getDisplayDetails

public String getDisplayDetails()
Gets the display details of this SourceContact.

Specified by:
getDisplayDetails in interface SourceContact
Returns:
the display details of this SourceContact
See Also:
SourceContact.getDisplayDetails()

getDisplayName

public String getDisplayName()
Gets the display name of this SourceContact.

Specified by:
getDisplayName in interface SourceContact
Returns:
the display name of this SourceContact
See Also:
SourceContact.getDisplayName()

getImage

public byte[] getImage()
Gets the image/avatar of this SourceContact.

Specified by:
getImage in interface SourceContact
Returns:
the image/avatar of this SourceContact
See Also:
SourceContact.getImage()

getPreferredContactDetail

public ContactDetail getPreferredContactDetail(Class<? extends OperationSet> operationSet)
Gets the preferred ContactDetail for a specific OperationSet.

Specified by:
getPreferredContactDetail in interface SourceContact
Parameters:
operationSet - the OperationSet to get the preferred ContactDetail for
Returns:
the preferred ContactDetail for the specified operationSet
See Also:
SourceContact.getPreferredContactDetail(Class)

setImage

public void setImage(byte[] image)
Sets the image/avatar of this SourceContact.

Parameters:
image - the image/avatar to be set on this SourceContact

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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