com.vodafone360.people.datatypes
Class ContactDetail

java.lang.Object
  extended by com.vodafone360.people.datatypes.BaseDataType
      extended by com.vodafone360.people.datatypes.ContactDetail

public class ContactDetail
extends BaseDataType

BaseDataType representing ContactDetails retrieved from, or issued to, server.

Contains a specific contact detail such as name, address, phone number, etc.


Nested Class Summary
static class ContactDetail.DetailKeys
          Contact Detail KEY definitions
static class ContactDetail.DetailKeyTypes
          Definitions of KEY types for Contact-Details.
private static class ContactDetail.MemberData
          Enumeration consisting of fields written to/from Parcel containing ContactDetail item.
private static class ContactDetail.Tags
          Tags associated with ContactDetail item.
 
Field Summary
 java.lang.String alt
          An alternative value to display for the contact detail
 java.lang.Long changeID
          Internal field which is a secondary key to link the detail with a change in the change log table.
protected static  CREATOR
          Interface to allow ContactDetail to be written and restored from a Parcel.
 java.lang.Boolean deleted
          True if the contact detail has been deleted on the server
 ContactDetail.DetailKeys key
          Determines which kind of contact detail this object refers to (name, address, phone number, etc)
 ContactDetail.DetailKeyTypes keyType
          Type of detail (home, business, work, etc.)
 java.lang.Long localContactID
          Secondary key which links the contact detail with a contact
 java.lang.Long localDetailID
          Primary key in the ContactDetails table
 Location location
          The location associated with the contact detail obtained from the server
private static java.lang.String LOCATION_DELIMITER
           
private static java.lang.String LOCATION_PROVIDER
           
 java.lang.Integer nativeContactId
          Internal field which is a secondary key linking the detail with a contact in the native address book.
 java.lang.Integer nativeDetailId
          Internal field which is a secondary key linking the detail with a contact detail in the native address book.
 java.lang.String nativeVal1
          A string copied from the native address book which can be used to determine if this contact has changed.
 java.lang.String nativeVal2
          A string copied from the native address book which can be used to determine if this contact has changed.
 java.lang.String nativeVal3
          A string copied from the native address book which can be used to determine if this contact has changed.
 java.lang.Integer order
          Contains the order in which the contact detail should be displayed.
static int ORDER_NORMAL
           
static int ORDER_PREFERRED
           
 Bitmap photo
          A photo associated with the detail.
 java.lang.String photo_mime_type
          The mime type of the image pointed to in the photo_url field.
 java.lang.String photo_url
          Contains the remote URL on the server where the image is located.
 java.lang.Long serverContactId
          Internal field which is used to cache the contact server ID.
 java.lang.Integer syncNativeContactId
          Internal field which is used to cache the sync native contact ID.
private static java.lang.String TYPE_PREFERRED
           
 java.lang.Long unique_id
          Contains the server ID if the contact detail has been synchronised with the server, null otherwise.
static java.lang.String UNKNOWN_NAME
           
 java.lang.Long updated
          Contains the last time the contact detail was updated on the server
 java.lang.String value
          Current value of the detail
 
Constructor Summary
  ContactDetail()
          Default constructor for ContactDetail.
private ContactDetail(Parcel in)
          Construct ContactDetail from supplied Parcel.
 
Method Summary
 void copy(ContactDetail source)
          Copy ContactDetail parameters from supplied ContactDetail item.
protected  ContactDetail createFromHashtable(java.util.Hashtable<java.lang.String,java.lang.Object> hash)
          Create ContactDetail from Hashtable generated by Hessian-decoder
 java.util.Hashtable<java.lang.String,java.lang.Object> createHastable()
          Create Hashtable containing ContactDetail parameters
 int describeContents()
          
private  ContactDetail.Tags findTag(java.lang.String tag)
          Find Tags item for specified String
 Time getDate()
          Get date value.
 java.lang.String getEmail()
           
 VCardHelper.Name getName()
          Return VCard name field
 VCardHelper.Organisation getOrg()
          Return organisation field value.
 VCardHelper.PostalAddress getPostalAddress()
          Get postal address
 java.lang.String getTel()
          Return telephone number as String
 java.lang.String getValue()
          Fetches single value from a VCard entry using VCardHelper class.
 java.lang.String name()
          Return name of the current Data-type.
private  boolean processType(java.lang.String typeString)
          Set key-type based on supplied key String.
private  void processTypeData(java.lang.String typeData)
          Attempt to set type based on supplied data.
private  void readFromParcel(Parcel in)
          Read ContactDetail item from supplied Parcel.
 void setDate(Time time, ContactDetail.DetailKeyTypes inType)
          Set VCard date field.
 void setEmail(java.lang.String emailAddress, ContactDetail.DetailKeyTypes inType)
          Set email address
 void setName(VCardHelper.Name name)
          Set VCard name field using VCardHelper.
 void setOrg(VCardHelper.Organisation org, ContactDetail.DetailKeyTypes type)
          Set VCard organisation field.
 void setPostalAddress(VCardHelper.PostalAddress address, ContactDetail.DetailKeyTypes inType)
          Set postal address.
 void setTel(java.lang.String tel, ContactDetail.DetailKeyTypes inType)
          Set telephone number.
private  void setValue(ContactDetail.Tags tag, java.lang.Object obValue)
          Sets the value of the member data item associated with the specified tag.
 void setValue(java.lang.String rawVal, ContactDetail.DetailKeys inKey, ContactDetail.DetailKeyTypes inType)
           
 java.lang.String toString()
          
 void writeToParcel(Parcel dest, int flags)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCATION_PROVIDER

private static final java.lang.String LOCATION_PROVIDER
See Also:
Constant Field Values

LOCATION_DELIMITER

private static final java.lang.String LOCATION_DELIMITER
See Also:
Constant Field Values

UNKNOWN_NAME

public static final java.lang.String UNKNOWN_NAME
See Also:
Constant Field Values

TYPE_PREFERRED

private static final java.lang.String TYPE_PREFERRED
See Also:
Constant Field Values

ORDER_PREFERRED

public static final int ORDER_PREFERRED
See Also:
Constant Field Values

ORDER_NORMAL

public static final int ORDER_NORMAL
See Also:
Constant Field Values

localDetailID

public java.lang.Long localDetailID
Primary key in the ContactDetails table


localContactID

public java.lang.Long localContactID
Secondary key which links the contact detail with a contact


key

public ContactDetail.DetailKeys key
Determines which kind of contact detail this object refers to (name, address, phone number, etc)


keyType

public ContactDetail.DetailKeyTypes keyType
Type of detail (home, business, work, etc.)


value

public java.lang.String value
Current value of the detail


deleted

public java.lang.Boolean deleted
True if the contact detail has been deleted on the server


updated

public java.lang.Long updated
Contains the last time the contact detail was updated on the server


unique_id

public java.lang.Long unique_id
Contains the server ID if the contact detail has been synchronised with the server, null otherwise.


order

public java.lang.Integer order
Contains the order in which the contact detail should be displayed. The lower the value, the higher in the list the contact detail should be.


alt

public java.lang.String alt
An alternative value to display for the contact detail


location

public Location location
The location associated with the contact detail obtained from the server


photo

public Bitmap photo
A photo associated with the detail. It is preferred that large objects such as photos are stored in the file system rather than the database. Hence this may never be used.


photo_mime_type

public java.lang.String photo_mime_type
The mime type of the image pointed to in the photo_url field.

See Also:
photo_url

photo_url

public java.lang.String photo_url
Contains the remote URL on the server where the image is located.

See Also:
photo_mime_type

serverContactId

public java.lang.Long serverContactId
Internal field which is used to cache the contact server ID. This is not stored in the database table.


syncNativeContactId

public java.lang.Integer syncNativeContactId
Internal field which is used to cache the sync native contact ID. This is not stored in the database table.


nativeContactId

public java.lang.Integer nativeContactId
Internal field which is a secondary key linking the detail with a contact in the native address book. Is null if this detail is not linked with the native address book.


nativeDetailId

public java.lang.Integer nativeDetailId
Internal field which is a secondary key linking the detail with a contact detail in the native address book. Is null if this detail is not linked with the native address book.


changeID

public java.lang.Long changeID
Internal field which is a secondary key to link the detail with a change in the change log table. The field is a temporary field used only during contact sync and is not stored or parcelled.


nativeVal1

public java.lang.String nativeVal1
A string copied from the native address book which can be used to determine if this contact has changed.

See Also:
nativeVal2, nativeVal3

nativeVal2

public java.lang.String nativeVal2
A string copied from the native address book which can be used to determine if this contact has changed.

See Also:
nativeVal1, nativeVal3

nativeVal3

public java.lang.String nativeVal3
A string copied from the native address book which can be used to determine if this contact has changed.

See Also:
nativeVal1, nativeVal2

CREATOR

protected static final  CREATOR
Interface to allow ContactDetail to be written and restored from a Parcel.

Constructor Detail

ContactDetail

public ContactDetail()
Default constructor for ContactDetail.


ContactDetail

private ContactDetail(Parcel in)
Construct ContactDetail from supplied Parcel.

Parameters:
in - Parcel containing ContactDetails.
Method Detail

findTag

private ContactDetail.Tags findTag(java.lang.String tag)
Find Tags item for specified String

Parameters:
tag - String value to find Tags item for
Returns:
Tags item for specified String, null otherwise

name

public java.lang.String name()
Return name of the current Data-type.

Specified by:
name in class BaseDataType
Returns:
String containing name of the data-type.

createHastable

public java.util.Hashtable<java.lang.String,java.lang.Object> createHastable()
Create Hashtable containing ContactDetail parameters

Returns:
Hashtable containing Contact detail parameters

createFromHashtable

protected ContactDetail createFromHashtable(java.util.Hashtable<java.lang.String,java.lang.Object> hash)
Create ContactDetail from Hashtable generated by Hessian-decoder

Parameters:
hash - Hashtable containing ContactDetail parameters
Returns:
ContactDetail created from Hashtable

setValue

private void setValue(ContactDetail.Tags tag,
                      java.lang.Object obValue)
Sets the value of the member data item associated with the specified tag.

Parameters:
tag - Current tag
val - Value associated with the tag

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

copy

public void copy(ContactDetail source)
Copy ContactDetail parameters from supplied ContactDetail item.

Parameters:
source - ContactDetail to copy from.

setValue

public void setValue(java.lang.String rawVal,
                     ContactDetail.DetailKeys inKey,
                     ContactDetail.DetailKeyTypes inType)
Parameters:
rawVal -
inKey -
inType -

getValue

public java.lang.String getValue()
Fetches single value from a VCard entry using VCardHelper class.

Returns:
value as String.

setName

public void setName(VCardHelper.Name name)
Set VCard name field using VCardHelper.

Parameters:
name - VCardHelper name item.

getName

public VCardHelper.Name getName()
Return VCard name field

Returns:
VCardHelper.Name containing name.

setOrg

public void setOrg(VCardHelper.Organisation org,
                   ContactDetail.DetailKeyTypes type)
Set VCard organisation field.

Parameters:
org - VCardHelper.Organisation containing representation of organisation fields.
type - detailKeyTypes (i.e. HOME/WORK).

getOrg

public VCardHelper.Organisation getOrg()
Return organisation field value.

Returns:
VCardHelper.Organisation containing organisation.

setDate

public void setDate(Time time,
                    ContactDetail.DetailKeyTypes inType)
Set VCard date field.

Parameters:
time - Time to set.
inType - detailKeyTypes for item (i.e BIRTHDAY).

getDate

public Time getDate()
Get date value.

Returns:
Time containing date value.

setEmail

public void setEmail(java.lang.String emailAddress,
                     ContactDetail.DetailKeyTypes inType)
Set email address

Parameters:
emailAddress - String containing email address
inType - detailKeyTypes vale specifying address type.

getEmail

public java.lang.String getEmail()

setPostalAddress

public void setPostalAddress(VCardHelper.PostalAddress address,
                             ContactDetail.DetailKeyTypes inType)
Set postal address.

Parameters:
address - VCardHelper.PostalAddress containing postal address fields.
inType - detailKeyTypes specifying address type.

getPostalAddress

public VCardHelper.PostalAddress getPostalAddress()
Get postal address

Returns:
postal address placed in VCardHelper.PostalAddress.

setTel

public void setTel(java.lang.String tel,
                   ContactDetail.DetailKeyTypes inType)
Set telephone number.

Parameters:
tel - String containing telephone number.
inType - detailKeyTypes identifying number type.

getTel

public java.lang.String getTel()
Return telephone number as String

Returns:
String containing telephone number.

processTypeData

private void processTypeData(java.lang.String typeData)
Attempt to set type based on supplied data. If type can not be determined the suppled data is used to populate 'alt;' field.

Parameters:
typeData - String containing type information.

processType

private boolean processType(java.lang.String typeString)
Set key-type based on supplied key String.

Parameters:
typeString - String containing type.
Returns:
true if the type is supported, false otherwise.

readFromParcel

private void readFromParcel(Parcel in)
Read ContactDetail item from supplied Parcel.

Parameters:
in - PArcel containing ContactDetail.

describeContents

public int describeContents()


writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)



JavaDoc