Package com.avaya.clientservices.contact

## Interface Contact

- All Superinterfaces:
    `BaseContact`

      public interface Contact
      extends BaseContact

  Represents an immutable contact object which exposes all possible contact details. The contact object can also be used to subscribe for presence updates.

  Contacts can be retrieved by using `ContactService` methods `ContactService.getContacts(DataRetrievalWatcher, ContactSourceType)` or `ContactService.searchContacts(DataRetrievalWatcher, String, ContactSearchScopeType, ContactSearchLocationType, int, int)`. Both methods take a DataRetrievalWatcher argument which allows the application to be notified about the status of the operation and changes to the list of contacts retrieved.

  This object cannot be used to edit the contact record. In order to update a contact record the following steps are required:

  1. Call `ContactService.createEditableContactFromContact(Contact)` to get an editable contact object.
  2. Make updates to the fields of the `EditableContact` object that was returned.
  3. Call `ContactService.updateContact(EditableContact, UpdateContactCompletionHandler)` to save the changes.
  See Also:
    `EditableContact`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addContactListener​(ContactListener contactListener)` | Adds the contact listener to get updates for this contact.
    `void` | `addPresenceListener​(PresenceSubscriptionListener presenceSubscriptionListener)` | Adds the presence listener to get presence updates for this contact.
    `Capability` | `getAddToGroupCapability()` | Capability indicating whether this contact can be added to a group.
    `ContactStringField` | `getASCIIAlias()` | The non-localized alias.
    `ContactStringField` | `getASCIIDisplayName()` | The non-localized display name.
    `ContactStringField` | `getASCIIFirstName()` | The non-localized first name.
    `ContactStringField` | `getASCIILastName()` | The non-localized last name.
    `ContactStringField` | `getCity()` | The city.
    `ContactStringField` | `getCompany()` | The company.
    `java.util.Set<ContactSourceType>` | `getContactSources()` | Returns list of contact sources
    `ContactStringField` | `getCountry()` | The country.
    `ContactMultiValueField<ContactStringField>` | `getCustom1()` | The list of custom1 values.
    `ContactMultiValueField<ContactStringField>` | `getCustom2()` | The list of custom2 values.
    `ContactMultiValueField<ContactStringField>` | `getCustom3()` | The list of custom3 values.
    `Capability` | `getDeleteContactCapability()` | Capability indicating whether this contact can be deleted.
    `ContactStringField` | `getDepartment()` | The department.
    `ContactEmailAddressFieldList` | `getEmailAddresses()` | The list of email addresses.
    `java.util.Map<java.lang.String,​ContactField>` | `getExtraFields()` | Contact extra fields
    `ContactIMAddressFieldList` | `getIMAddresses()` | The list of IM addresses.
    `ContactStringField` | `getIMAttributeValue()` | Deprecated. Always returns empty string.
    `ContactStringField` | `getLanguage()` | The language is per contact record.
    `ContactStringField` | `getLocation()` | The location.
    `ContactStringField` | `getManager()` | The name of a person who is a supervisor.
    `ContactStringField` | `getNativeAlias()` | The native alias.
    `ContactStringField` | `getNativeDisplayName()` | The native display name.
    `ContactStringField` | `getNativeFirstName()` | The native first name.
    `ContactStringField` | `getNativeLastName()` | The native last name.
    `ContactStringField` | `getNotes()` | The notes field.
    `ContactPhoneFieldList` | `getPhoneNumbers()` | The list of phone numbers.
    `byte[]` | `getPictureData()` | The contact picture bytes.
    `ContactStringField` | `getPostalCode()` | The postal code.
    `Presence` | `getPresence()` | The presence state of this contact.
    `ContactDoubleField` | `getRank()` | The rank field defining the contact sorting order.
    `ContactStringField` | `getState()` | The state.
    `ContactStringField` | `getStreetAddress()` | The street address.
    `ContactStringField` | `getTitle()` | The title or company role.
    `java.lang.String` | `getUniqueAddressForMatching()` | The matching/merging address.
    `Capability` | `getUpdateContactCapability()` | Capability indicating whether this contact can be updated.
    `boolean` | `hasPicture()` | Indicating whether contact has a picture.
    `ContactBoolField` | `isBuddy()` | The buddy flag.
    `ContactBoolField` | `isFavorite()` | The favorite flag.
    `ContactBoolField` | `isVIP()` | The VIP flag.
    `void` | `removeContactListener​(ContactListener contactListener)` | Removes the contact listener to stop getting updates for this contact.
    `void` | `removePictureFromCache()` | Removes contact's picture from cache.
    `void` | `removePresenceListener​(PresenceSubscriptionListener presenceSubscriptionListener)` | Removes the presence listener to stop getting presence updates for this contact.
    `void` | `retrievePicture​(ContactCompletionHandler handler)` | Retrieves the picture for contact.
    `void` | `startPresence​(AccessControlBehavior accessControlBehavior, PresenceCompletionHandler completionHandler)` | Begin monitoring presence for this contact.
    `void` | `stopPresence​(PresenceCompletionHandler completionHandler)` | Stop monitoring presence for this contact.

    - ### Methods inherited from interface com.avaya.clientservices.contact.BaseContact

      `canAddEmailAddress, canAddEmailAddress, canAddIMAddress, canAddPhoneNumber, isExtendedContactDetailsAvailable, isVideoCapable`

- - ### Method Detail

    - #### addContactListener

          void addContactListener​(ContactListener contactListener)

      Adds the contact listener to get updates for this contact.
      Parameters:
        `contactListener` - The listener to register with this object.

    - #### removeContactListener

          void removeContactListener​(ContactListener contactListener)

      Removes the contact listener to stop getting updates for this contact.
      Parameters:
        `contactListener` - The listener to unregister from this object.

    - #### getPresence

          Presence getPresence()

      The presence state of this contact.

      Note that for the presence to start being updated, `startPresence(AccessControlBehavior, PresenceCompletionHandler)` must be invoked. If presence will no longer be needed, use `stopPresence(PresenceCompletionHandler)` in order to stop the presence subscription.

      Returns:
        `Presence` of this contact.

    - #### addPresenceListener

          void addPresenceListener​(PresenceSubscriptionListener presenceSubscriptionListener)

      Adds the presence listener to get presence updates for this contact.
      Parameters:
        `presenceSubscriptionListener` - The listener to register with this object.

    - #### removePresenceListener

          void removePresenceListener​(PresenceSubscriptionListener presenceSubscriptionListener)

      Removes the presence listener to stop getting presence updates for this contact.
      Parameters:
        `presenceSubscriptionListener` - The listener to unregister from this object.

    - #### startPresence

          void startPresence​(AccessControlBehavior accessControlBehavior,
                             PresenceCompletionHandler completionHandler)

      Begin monitoring presence for this contact. Once the operation is completed, `getPresence()` will return the actual presence information for the contact. See also method `stopPresence(PresenceCompletionHandler)`.
      Parameters:
        `accessControlBehavior` - Type of the ACL - confirm policy handling.
        `completionHandler` - Completion handler for this operation.

    - #### stopPresence

          void stopPresence​(PresenceCompletionHandler completionHandler)

      Stop monitoring presence for this contact. Once the operation is completed, `getPresence()` will not be able to provide the actual user's presence information.
      Parameters:
        `completionHandler` - Completion handler for this operation.

    - #### retrievePicture

          void retrievePicture​(ContactCompletionHandler handler)

      Retrieves the picture for contact. Check if the picture is available using the `hasPicture()` method.
      Parameters:
        `handler` - Completion handler for this operation.
      See Also:
        `removePictureFromCache()`

    - #### removePictureFromCache

          void removePictureFromCache()

      Removes contact's picture from cache. This method helps to manage the application memory. When the contact picture is not needed, it can be removed and downloaded again in the future.
      See Also:
        `retrievePicture(ContactCompletionHandler)`

    - #### getASCIILastName

          ContactStringField getASCIILastName()

      Description copied from interface: `BaseContact`
      The non-localized last name.
      Specified by:
        `getASCIILastName` in interface `BaseContact`
      Returns:
        Contact string field containing non-localized last name.

    - #### getASCIIFirstName

          ContactStringField getASCIIFirstName()

      Description copied from interface: `BaseContact`
      The non-localized first name.
      Specified by:
        `getASCIIFirstName` in interface `BaseContact`
      Returns:
        Contact string field containing non-localized first name.

    - #### getASCIIDisplayName

          ContactStringField getASCIIDisplayName()

      Description copied from interface: `BaseContact`
      The non-localized display name.
      Specified by:
        `getASCIIDisplayName` in interface `BaseContact`
      Returns:
        Contact string field containing non-localized display name.

    - #### getASCIIAlias

          ContactStringField getASCIIAlias()

      Description copied from interface: `BaseContact`
      The non-localized alias.
      Specified by:
        `getASCIIAlias` in interface `BaseContact`
      Returns:
        Contact string field containing a non-localized alias.

    - #### getNativeLastName

          ContactStringField getNativeLastName()

      Description copied from interface: `BaseContact`
      The native last name.
      Specified by:
        `getNativeLastName` in interface `BaseContact`
      Returns:
        Contact string field containing the native last name.

    - #### getNativeFirstName

          ContactStringField getNativeFirstName()

      Description copied from interface: `BaseContact`
      The native first name.
      Specified by:
        `getNativeFirstName` in interface `BaseContact`
      Returns:
        Contact string field containing the native first name.

    - #### getNativeDisplayName

          ContactStringField getNativeDisplayName()

      Description copied from interface: `BaseContact`
      The native display name.
      Specified by:
        `getNativeDisplayName` in interface `BaseContact`
      Returns:
        Contact string field containing the native display name.

    - #### getNativeAlias

          ContactStringField getNativeAlias()

      Description copied from interface: `BaseContact`
      The native alias.
      Specified by:
        `getNativeAlias` in interface `BaseContact`
      Returns:
        Contact string field containing the native alias.

    - #### getLocation

          ContactStringField getLocation()

      Description copied from interface: `BaseContact`
      The location.
      Specified by:
        `getLocation` in interface `BaseContact`
      Returns:
        Contact string field containing the location.

    - #### getStreetAddress

          ContactStringField getStreetAddress()

      Description copied from interface: `BaseContact`
      The street address.
      Specified by:
        `getStreetAddress` in interface `BaseContact`
      Returns:
        Contact string field containing the street address.

    - #### getCity

          ContactStringField getCity()

      Description copied from interface: `BaseContact`
      The city.
      Specified by:
        `getCity` in interface `BaseContact`
      Returns:
        Contact string field containing the city.

    - #### getState

          ContactStringField getState()

      Description copied from interface: `BaseContact`
      The state.
      Specified by:
        `getState` in interface `BaseContact`
      Returns:
        Contact string field containing the state.

    - #### getCountry

          ContactStringField getCountry()

      Description copied from interface: `BaseContact`
      The country.
      Specified by:
        `getCountry` in interface `BaseContact`
      Returns:
        Contact string field containing the country.

    - #### getPostalCode

          ContactStringField getPostalCode()

      Description copied from interface: `BaseContact`
      The postal code.
      Specified by:
        `getPostalCode` in interface `BaseContact`
      Returns:
        Contact string field containing the postal code.

    - #### getCompany

          ContactStringField getCompany()

      Description copied from interface: `BaseContact`
      The company.
      Specified by:
        `getCompany` in interface `BaseContact`
      Returns:
        Contact string field containing the company.

    - #### getDepartment

          ContactStringField getDepartment()

      Description copied from interface: `BaseContact`
      The department.
      Specified by:
        `getDepartment` in interface `BaseContact`
      Returns:
        Contact string field containing the department.

    - #### getManager

          ContactStringField getManager()

      Description copied from interface: `BaseContact`
      The name of a person who is a supervisor.
      Specified by:
        `getManager` in interface `BaseContact`
      Returns:
        Contact string field containing the name of a person who is a supervisor.

    - #### getTitle

          ContactStringField getTitle()

      Description copied from interface: `BaseContact`
      The title or company role.
      Specified by:
        `getTitle` in interface `BaseContact`
      Returns:
        Contact string field containing the title or company role.

    - #### getLanguage

          ContactStringField getLanguage()

      Description copied from interface: `BaseContact`
      The language is per contact record.
      Specified by:
        `getLanguage` in interface `BaseContact`
      Returns:
        Contact string field containing the language is per contact record.

    - #### getUniqueAddressForMatching

          java.lang.String getUniqueAddressForMatching()

      Description copied from interface: `BaseContact`
      The matching/merging address. This parameter can be used as a record's unique id.
      Specified by:
        `getUniqueAddressForMatching` in interface `BaseContact`
      Returns:
        Contact string field containing the matching/merging address.

    - #### getEmailAddresses

          ContactEmailAddressFieldList getEmailAddresses()

      Description copied from interface: `BaseContact`
      The list of email addresses.
      Specified by:
        `getEmailAddresses` in interface `BaseContact`
      Returns:
        Contact multi value field containing list of email addresses.

    - #### getPhoneNumbers

          ContactPhoneFieldList getPhoneNumbers()

      Description copied from interface: `BaseContact`
      The list of phone numbers.
      Specified by:
        `getPhoneNumbers` in interface `BaseContact`
      Returns:
        Contact multi value field containing list of phone numbers.

    - #### getIMAddresses

          ContactIMAddressFieldList getIMAddresses()

      Description copied from interface: `BaseContact`
      The list of IM addresses.
      Specified by:
        `getIMAddresses` in interface `BaseContact`
      Returns:
        Contact multi value field containing list of IM addresses.

    - #### isBuddy

          ContactBoolField isBuddy()

      Description copied from interface: `BaseContact`
      The buddy flag. Used for presence feature purpose.
      Specified by:
        `isBuddy` in interface `BaseContact`
      Returns:
        Contact bool field containing the buddy flag.

    - #### isVIP

          ContactBoolField isVIP()

      Description copied from interface: `BaseContact`
      The VIP flag.
      Specified by:
        `isVIP` in interface `BaseContact`
      Returns:
        Contact bool field containing the VIP flag.

    - #### isFavorite

          ContactBoolField isFavorite()

      Description copied from interface: `BaseContact`
      The favorite flag.
      Specified by:
        `isFavorite` in interface `BaseContact`
      Returns:
        Contact bool field containing the favorite flag.

    - #### getPictureData

          byte[] getPictureData()

      The contact picture bytes. Picture data can be in jpeg or png format.
      Returns:
        byte array containing the contact picture bytes.

    - #### hasPicture

          boolean hasPicture()

      Indicating whether contact has a picture.
      Returns:
        true if contact has a picture.

    - #### getIMAttributeValue

          ContactStringField getIMAttributeValue()

      Deprecated.
      Always returns empty string.
      This method is deprecated and always returns empty string.
      Returns:
        empty string.

    - #### getNotes

          ContactStringField getNotes()

      Description copied from interface: `BaseContact`
      The notes field.
      Specified by:
        `getNotes` in interface `BaseContact`
      Returns:
        Contact string field containing the notes field.

    - #### getRank

          ContactDoubleField getRank()

      Description copied from interface: `BaseContact`
      The rank field defining the contact sorting order. 0.0 value means "No rank". Higher values are sorted toward top of the list.
      Specified by:
        `getRank` in interface `BaseContact`
      Returns:
        Non-negative double value.

    - #### getCustom1

          ContactMultiValueField<ContactStringField> getCustom1()

      Description copied from interface: `BaseContact`
      The list of custom1 values.
      Specified by:
        `getCustom1` in interface `BaseContact`
      Returns:
        list of custom1 values.

    - #### getCustom2

          ContactMultiValueField<ContactStringField> getCustom2()

      Description copied from interface: `BaseContact`
      The list of custom2 values.
      Specified by:
        `getCustom2` in interface `BaseContact`
      Returns:
        list of custom2 values.

    - #### getCustom3

          ContactMultiValueField<ContactStringField> getCustom3()

      Description copied from interface: `BaseContact`
      The list of custom3 values.
      Specified by:
        `getCustom3` in interface `BaseContact`
      Returns:
        list of custom3 values.

    - #### getExtraFields

          java.util.Map<java.lang.String,​ContactField> getExtraFields()

      Description copied from interface: `BaseContact`
      Contact extra fields
      Specified by:
        `getExtraFields` in interface `BaseContact`
      Returns:
        Map object containing contact extra fields as ContactField with String key. Key values are in `ExtraFieldKeys` class.

    - #### getContactSources

          java.util.Set<ContactSourceType> getContactSources()

      Returns list of contact sources
      Returns:
        list of contact sources

    - #### getUpdateContactCapability

          Capability getUpdateContactCapability()

      Capability indicating whether this contact can be updated. See also `ContactService.updateContact(EditableContact, UpdateContactCompletionHandler)`
      Returns:
        `Capability` object describing whether or not this particular contact can be changed.

    - #### getDeleteContactCapability

          Capability getDeleteContactCapability()

      Capability indicating whether this contact can be deleted. See `ContactService.deleteContact(Contact, ContactCompletionHandler)`.
      Returns:
        `Capability` object describing whether or not this particular contact can be deleted.

    - #### getAddToGroupCapability

          Capability getAddToGroupCapability()

      Capability indicating whether this contact can be added to a group.
      Returns:
        `Capability` object describing whether or not this particular contact can be added to a group.