An AddressBook is a Repository which can have linked contact records. The contact records provide a search optimised view of the CARDDAV data held in the repository
Group: Database Entities
Extends: Repository
Properties
| Property | Returns | Description |
|---|---|---|
| contacts | List<Contact> | The search optimised contact records linked to this address book. May be null when no contacts have been loaded or created. Each entry is a summary of a contact whose full record lives as CardDAV text in this repository, and deleting the address book deletes them all. |
| repoType | String | The repository type code, always AB for an address book. Use it to tell address books apart from other kinds of repository without a type check. Not persisted. |
Inherited from Repository
Properties
| Property | Returns | Description |
|---|---|---|
| baseEntity | BaseEntity | The entity that contains this repository. The entity might be a user, organisation, etc The repository name must be unique within its parent entity |
| branches | List<Branch> | |
| category | RepositoryCategory | |
| createdDate | Date | |
| deleted | Boolean | To support soft deletes |
| id | long | |
| liveBranch | String | |
| name | String | |
| notes | String | |
| publicContent | boolean | |
| publishedBy | Profile | |
| publishedDate | Date | |
| title | String | |
| trunk | Branch | |
| type | String |
Methods
getRepoType()
Returns: String
The repository type code, always AB for an address book. Use it to tell address books apart from other kinds of repository without a type check. Not persisted.
getContacts()
Returns: List<Contact>
The search optimised contact records linked to this address book. May be null when no contacts have been loaded or created. Each entry is a summary of a contact whose full record lives as CardDAV text in this repository, and deleting the address book deletes them all.
contact(String name)
Returns: Contact
Finds the contact in this address book with the given resource name by scanning the loaded contact list, so the cost grows with the number of contacts. Matching is exact and case sensitive.
| Parameter | Description |
|---|---|
name | the resource name of the contact to find, as returned by the contact's getName |
add(String name)
Returns: Contact
Builds a new contact pointing at this address book with the given resource name and returns it. The contact is not added to the contacts list and is not saved, so the caller has to persist it and is responsible for keeping the name unique.
| Parameter | Description |
|---|---|
name | the resource name to give the new contact |