Holger's Java API

## com.antelmann.crm
Class ContactImpl<T extends Keyword>

    java.lang.Object
      com.antelmann.db.AbstractDBEntry
          com.antelmann.db.PropertyEntryImpl
              com.antelmann.crm.ContactImpl<T>

All Implemented Interfaces:
  Addressable, Contact, DBEntry, PropertyEntry, Taggable<T>, Imageable, DetailedString, Enabled, LifeCycleObject, Serializable, Comparable<Contact>

Direct Known Subclasses:
  PersonImpl

    public abstract class ContactImpl<T extends Keyword>

extends PropertyEntryImpl
implements Contact, Comparable<Contact>, Taggable<T>

a base implementation for a Contact

Since:
  20.11.2008, 01:09:43
Author:
  Holger Antelmann
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface com.antelmann.db.Taggable
`Taggable.Adapter<T extends Tag>`

Field Summary

Fields inherited from class com.antelmann.db.PropertyEntryImpl
`propertyChangeSupport, props, um, vcs`

Fields inherited from interface com.antelmann.db.DBEntry
`ENTRY_FLAVOR, ENTRY_LIST_FLAVOR`

Fields inherited from interface com.antelmann.util.Enabled
`FILTER`

Constructor Summary
`ContactImpl(Object id)`
`ContactImpl(Object id, GlobalAddress adr)`
`ContactImpl(Object id, GlobalAddress adr, Map<String,Object> map)`
`ContactImpl(Object id, Map<String,Object> map)`
`ContactImpl(Object id, PropertyEntryImpl entry)`

Method Summary
`void` `add(AddressInfo ai)`
`void` `add(AddressInfo ai, int index)` adds an address at the given index (optional operation)
`boolean` `add(T tag)` makes this instance member of the given group
`boolean` `addTag(String keyword)`
`int` `compareTo(Contact c)`
`protected T` `createTag(String tagName)`
`GlobalAddress` `getAddress()` always returns a non-null value referring directly to the embedded main Address instance, which provides a way to 'address' the implementing instance
`Date` `getBeginTime()`
`String` `getBusinessCardString()` the returned String (as opposed to `toDetailedString()` uses `Strings.lb`
`String` `getContactName()` provides an internally used name suitable for display in list views
`String` `getContactNotes()` provides some notes on this contact
`Image` `getDisplayIcon()` returns an image that is suitable for use as an icon for this instance.
`Image` `getDisplayImage()` returns an image that represents a visual representation of this instance.
`Date` `getEndTime()`
`ImageHolder` `getIconHolder()` allows to modify the image for `getDisplayIcon()`
`ImageHolder` `getImageHolder()`
`String[]` `getKeywords()`
`List<? extends AddressInfo>` `getMoreAddresses()` allows to retrieve additional (editable) addresses for a given contact.
`Collection<T>` `getTags()` lists all groups that this instance is currently a member of (the data is essentially derived from a set)
`abstract Class<T>` `getTagType()`
`boolean` `hasKeyword(String keyword)`
`boolean` `isEnabled()` determines whether this object is currently enabled
`boolean` `isTagged(T tag)` allows to determine the membership of the given tag or group
`boolean` `remove(T tag)` terminates the membership of this instance to the given group
`AddressInfo` `removeAddress(int index)` removes (and returns) an address at the given index (optional operation)
`boolean` `removeKeyword(String keyword)`
`void` `setBeginTime(Date beginTime)`
`void` `setContactName(String name)`
`void` `setContactNotes(String notes)`
`void` `setDisplayImage(BinaryData data)`
`void` `setDisplayImage(Image image)`
`void` `setDisplayImage(URL url)`
`void` `setDisplayImage(ValueRetriever<Image> imageRetriever)`
`void` `setEnabled(boolean flag)` allows to enable/disable this instance
`void` `setEndTime(Date endTime)`
`String` `toDetailedString()` provides full details of this instance in a String.
`String` `toString()`

Methods inherited from class com.antelmann.db.PropertyEntryImpl

`addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, asProperties, canRedo, canUndo, checkPropertyChange, clearProperties, containsPropertyText, containsValuePattern, equalWithProperties, equalWithProperties, getBoolean, getNumber, getProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyComparator, getPropertyExtractor, getPropertyExtractor, getPropertyKeys, getStringExtractor, getVetoableChangeListeners, isCaseInsensitive, isChangeListenerSupportEnabled, isKeyIn, isUndoSupport, isVetoableChangeSupportEnabled, putAll, redo, removeProperty, removePropertyChangeListener, removeVetoableChangeListener, setAllFrom, setCaseInsensitive, setChangeListenerSupport, setProperty, setUndoSupported, setVetoableChangeSupport, undo, verifyProperties`

Methods inherited from class com.antelmann.db.AbstractDBEntry
`equals, getID, hashCode, hashEntry, sameEntry`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.antelmann.db.DBEntry
`getID`

Constructor Detail

### ContactImpl

    public ContactImpl(Object id)

### ContactImpl

    public ContactImpl(Object id,
                       GlobalAddress adr)

### ContactImpl

    public ContactImpl(Object id,
                       PropertyEntryImpl entry)

### ContactImpl

    public ContactImpl(Object id,
                       Map<String,Object> map)

### ContactImpl

    public ContactImpl(Object id,
                       GlobalAddress adr,
                       Map<String,Object> map)

Method Detail

### toString

    public String toString()

  Overrides:
    `toString` in class `AbstractDBEntry`

### compareTo

    public int compareTo(Contact c)

  Specified by:
    `compareTo` in interface `Comparable<Contact>`

### getContactName

    public String getContactName()

  Description copied from interface: `Contact`
  provides an internally used name suitable for display in list views

  Specified by:
    `getContactName` in interface `Contact`

### setContactName

    public void setContactName(String name)

### getContactNotes

    public String getContactNotes()

  Description copied from interface: `Contact`
  provides some notes on this contact

  Specified by:
    `getContactNotes` in interface `Contact`

### setContactNotes

    public void setContactNotes(String notes)

### getMoreAddresses

    public List<? extends AddressInfo> getMoreAddresses()

  Description copied from interface: `Contact`
  allows to retrieve additional (editable) addresses for a given contact.

  Specified by:
    `getMoreAddresses` in interface `Contact`
  Returns:
    possibly an empty list, but not null; while the list elements are editable, the list itself is immutable

### add

    public void add(AddressInfo ai)

### add

    public void add(AddressInfo ai,
                    int index)
             throws IndexOutOfBoundsException

  Description copied from interface: `Contact`
  adds an address at the given index (optional operation)

  Specified by:
    `add` in interface `Contact`
  Throws:
    `IndexOutOfBoundsException`

### removeAddress

    public AddressInfo removeAddress(int index)
                              throws IndexOutOfBoundsException

  Description copied from interface: `Contact`
  removes (and returns) an address at the given index (optional operation)

  Specified by:
    `removeAddress` in interface `Contact`
  Throws:
    `IndexOutOfBoundsException`

### getDisplayImage

    public Image getDisplayImage()
                          throws IOException

  Description copied from interface: `Imageable`
  returns an image that represents a visual representation of this instance. The method may return null;

  Specified by:
    `getDisplayImage` in interface `Imageable`
  Throws:
    `IOException`

### setDisplayImage

    public void setDisplayImage(Image image)

### setDisplayImage

    public void setDisplayImage(ValueRetriever<Image> imageRetriever)

### setDisplayImage

    public void setDisplayImage(URL url)

### setDisplayImage

    public void setDisplayImage(BinaryData data)

### getImageHolder

    public ImageHolder getImageHolder()

### getDisplayIcon

    public Image getDisplayIcon()
                         throws IOException

  Description copied from interface: `Imageable`
  returns an image that is suitable for use as an icon for this instance. The method may return null;

  Specified by:
    `getDisplayIcon` in interface `Imageable`
  Throws:
    `IOException`
  See Also:
    `getIconHolder()`

### getIconHolder

    public ImageHolder getIconHolder()

  allows to modify the image for `getDisplayIcon()`

### getBusinessCardString

    public String getBusinessCardString()

  the returned String (as opposed to `toDetailedString()` uses `Strings.lb`

### toDetailedString

    public String toDetailedString()

  Description copied from interface: `DetailedString`
  provides full details of this instance in a String. In case the String contains multiple lines, it is recommended to use '\n' rather than the platform specific line-break for better compatibility.

  Specified by:
    `toDetailedString` in interface `DetailedString`
  Overrides:
    `toDetailedString` in class `PropertyEntryImpl`
  Returns:
    a (potentially multi-line) String providing full details on this object instance

### getAddress

    public GlobalAddress getAddress()

  Description copied from interface: `Addressable`
  always returns a non-null value referring directly to the embedded main Address instance, which provides a way to 'address' the implementing instance

  Specified by:
    `getAddress` in interface `Addressable`

### getBeginTime

    public Date getBeginTime()

  Specified by:
    `getBeginTime` in interface `LifeCycleObject`

### setBeginTime

    public void setBeginTime(Date beginTime)

### getEndTime

    public Date getEndTime()

  Specified by:
    `getEndTime` in interface `LifeCycleObject`

### setEndTime

    public void setEndTime(Date endTime)

### isEnabled

    public boolean isEnabled()

  Description copied from interface: `Enabled`
  determines whether this object is currently enabled

  Specified by:
    `isEnabled` in interface `Enabled`

### setEnabled

    public void setEnabled(boolean flag)

  Description copied from interface: `Enabled`
  allows to enable/disable this instance

  Specified by:
    `setEnabled` in interface `Enabled`

### getTagType

    public abstract Class<T> getTagType()

### createTag

    protected T createTag(String tagName)

### addTag

    public boolean addTag(String keyword)

### add

    public boolean add(T tag)

  Description copied from interface: `Taggable`
  makes this instance member of the given group

  Specified by:
    `add` in interface `Taggable<T extends Keyword>`
  Parameters:
    `tag` - the Group object that this instance is to become a member of
  Returns:
    true only if the group was actually added to this instance or false if it already was a member of that group

### getTags

    public Collection<T> getTags()

  Description copied from interface: `Taggable`
  lists all groups that this instance is currently a member of (the data is essentially derived from a set)

  Specified by:
    `getTags` in interface `Taggable<T extends Keyword>`

### getKeywords

    public String[] getKeywords()

### hasKeyword

    public boolean hasKeyword(String keyword)

### isTagged

    public boolean isTagged(T tag)

  Description copied from interface: `Taggable`
  allows to determine the membership of the given tag or group

  Specified by:
    `isTagged` in interface `Taggable<T extends Keyword>`

### removeKeyword

    public boolean removeKeyword(String keyword)

### remove

    public boolean remove(T tag)

  Description copied from interface: `Taggable`
  terminates the membership of this instance to the given group

  Specified by:
    `remove` in interface `Taggable<T extends Keyword>`
  Parameters:
    `tag` - the Group that this instance is to be removed from as a member
  Returns:
    true only if this instance was previously a member of the given group.

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads