com.vodafone360.people.engine.contactsync
Class ContactChange

java.lang.Object
  extended by com.vodafone360.people.engine.contactsync.ContactChange

public class ContactChange
extends java.lang.Object

Class describing a Contact Change. A Contact Change is meant to represent the smallest chunk of data associated with a Contact whilst being able to map and track its properties: - Origin (via IDs and type); - Purpose (destination); - Attributes (IDs, Key, Value and Flags)


Field Summary
static java.lang.String ATTRIBUTE_BIRTHDAY
          BIRTHDAY FLAG
static java.lang.String ATTRIBUTE_CELL
          TODO: Needed?!
static java.lang.String ATTRIBUTE_FAX
          TODO: Needed?!
static java.lang.String ATTRIBUTE_HOME
          TODO: Needed?!
static java.lang.String ATTRIBUTE_PREFERRED
          TODO: Needed?!
static java.lang.String ATTRIBUTE_WORK
          TODO: Needed?!
static int DESTINATION_FLAG_CAB
          CAB destination
static int DESTINATION_FLAG_NAB
          NAB destination
static int DESTINATION_FLAG_NONE
          None (null) destination
static int DESTINATION_FLAG_RPG
          RPG destination
static int DESTINATIONS_CAB_NAB
          Incoming via RPG.
static int DESTINATIONS_CAB_NAB_RPG
          Incoming via client.
static int DESTINATIONS_CAB_RPG
          Incoming via NAB.
static int FLAG_BIRTHDAY
          TODO: Needed?!
static int FLAG_CELL
          CELL Flag
static int FLAG_FAX
          FAX flag
static int FLAG_HOME
          HOME Flag
static int FLAG_NONE
          None (null) flag
static int FLAG_PREFERRED
          Preferred Flag
static int FLAG_WORK
          WORK Flag
static int FLAGS_HOME_CELL
          HOME and CELL Flag combination for convenience purposes
static int FLAGS_HOME_FAX
          HOME and FAX Flag combination for convenience purposes
static int FLAGS_WORK_CELL
          WORK and CELL Flag combination for convenience purposes
static int FLAGS_WORK_FAX
          WORK and FAX Flag combination for convenience purposes
static long INVALID_ID
          Invalid ID value applicable to any ID within this class
static int KEY_BOOKMARK
          BOOKMARK Key
static int KEY_EXTERNAL
          EXTERNAL Key
static int KEY_FOLDER
          FOLDER Key
static int KEY_GENDER
          GENDER Key
static int KEY_GROUP
          GROUP Key
static int KEY_INTEREST
          INTEREST Key
static int KEY_LINK
          LINK Key
static int KEY_LOCATION
          LOCATION Key
static int KEY_PHOTO
          PHOTO Key
static int KEY_PRESENCE_TEXT
          PRESENCE_TEXT Key
static int KEY_RELATION
          RELATION Key
static int KEY_UNKNOWN
          UNKNOWN Key
static int KEY_VCARD_ADDRESS
          ADDRESS Key
static int KEY_VCARD_BUSINESS
          BUSINESS Key
static int KEY_VCARD_DATE
          DATE Key
static int KEY_VCARD_EMAIL
          EMAIL Key
static int KEY_VCARD_IMADDRESS
          IM_ADDRESS Key
static int KEY_VCARD_INTERNET_ADDRESS
          INTERNET_ADDRESS Key
static int KEY_VCARD_NAME
          NAME Key
static int KEY_VCARD_NICKNAME
          NICKNAME Key
static int KEY_VCARD_NOTE
          NOTE Key
static int KEY_VCARD_ORG
          ORG Key
static int KEY_VCARD_PHONE
          PHONE Key
static int KEY_VCARD_ROLE
          ROLE Key
static int KEY_VCARD_TITLE
          TITLE Key
static int KEY_VCARD_URL
          URL Key
private  long mBackendContactId
          Backend Contact ID for this ContactChange
private  long mBackendDetailId
          Backend Detail ID for this ContactChange
private  int mDestinations
          Destination flags for this ContactChange
private  int mFlags
          Flags for this ContactChange
private  long mInternalContactId
          Internal Contact ID for this ContactChange
private  long mInternalDetailId
          Internal Detail ID for this ContactChange
private  int mKey
          Key for this ContactChange
private  long mNabContactId
          NAB Contact ID for this ContactChange
private  long mNabDetailId
          NAB Detail ID for this ContactChange
private  int mType
          Type for this ContactChange
private  java.lang.String mValue
          Value for this ContactChange
private static java.lang.String[] sIntToKeyLookupTable
          Lookup Table from Key integer to String values
private static java.util.HashMap<java.lang.String,java.lang.Integer> sKeyToIntMap
          Hashmap from Key String to integer values
static int TYPE_ADD_CONTACT
          ADD_CONTACT Type
static int TYPE_ADD_DETAIL
          ADD_DETAIL Type
static int TYPE_DELETE_CONTACT
          DELETE_CONTACT Type
static int TYPE_DELETE_DETAIL
          UPDATE_DELETE_DETAIL Type
static int TYPE_UNKNOWN
          UNKNOWN Type
static int TYPE_UPDATE_BACKEND_CONTACT_ID
          UPDATE_BACKEND_CONTACT_ID Type
static int TYPE_UPDATE_BACKEND_DETAIL_ID
          UPDATE_BACKEND_DETAIL_ID Type
static int TYPE_UPDATE_CONTACT
          UPDATE_CONTACT Type
static int TYPE_UPDATE_DETAIL
          UPDATE_DETAIL Type
static int TYPE_UPDATE_NAB_CONTACT_ID
          UPDATE_NAB_CONTACT_ID Type
static int TYPE_UPDATE_NAB_DETAIL_ID
          UPDATE_NAB_DETAIL_ID Type
 
Constructor Summary
ContactChange()
          Default constructor
ContactChange(int type)
          Constructor taking the change type
ContactChange(int destinations, int type)
          Constructor taking destination flags and a type
ContactChange(int key, java.lang.String value, int flags)
          Constructor taking key, value and flags
ContactChange(long nabContactId)
          Constructor taking a nabContactId
ContactChange(long nabContactId, long nabDetailId)
          Constructor taking a nabContactId and a nabDetailId
 
Method Summary
 ContactChange copyWithNewValue(java.lang.String newValue)
          Creates a copy of the ContactChange with a modified value.
static ContactChange createIdsChange(ContactChange cc, int type)
          Creates a shallow copy of a change.
 long getBackendContactId()
          Get the change's Backend Contact ID.
 long getBackendDetailId()
          Get the change's Backend Detail ID.
 int getDestinations()
          Get the change destination flags.
 int getFlags()
          Get the change flags.
 long getInternalContactId()
          Get the change's Internal Contact ID.
 long getInternalDetailId()
          Get the change's Internal Detail ID.
 int getKey()
          Get the change Key.
 java.lang.String getKeyToString()
          Get the change Key String value.
 long getNabContactId()
          Get the change's NAB Contact ID.
 long getNabDetailId()
          Get the change's NAB Detail ID.
 int getType()
          Get the change type.
 java.lang.String getValue()
          Get the change value
 void setBackendContactId(long backendContactId)
          Set the change's Backend Contact ID.
 void setBackendDetailId(long backendDetailId)
          Set the change's Backend Detail ID.
 void setDestinations(int destinations)
          Set the change destination flags.
 void setFlags(int flags)
          Set the change flags.
 void setInternalContactId(long internalContactId)
          Set the change's Internal Contact ID.
 void setInternalDetailId(long internalDetailId)
          Set the change's Internal Detail ID.
 void setKey(int key)
          Sets the key.
 void setNabContactId(long nabContactId)
          Set the change's NAB Contact ID.
 void setNabDetailId(long nabDetailId)
          Set the change's NAB Detail ID.
 void setType(int type)
          Set the type of change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
UNKNOWN Type

See Also:
Constant Field Values

TYPE_ADD_CONTACT

public static final int TYPE_ADD_CONTACT
ADD_CONTACT Type

See Also:
Constant Field Values

TYPE_UPDATE_CONTACT

public static final int TYPE_UPDATE_CONTACT
UPDATE_CONTACT Type

See Also:
Constant Field Values

TYPE_DELETE_CONTACT

public static final int TYPE_DELETE_CONTACT
DELETE_CONTACT Type

See Also:
Constant Field Values

TYPE_ADD_DETAIL

public static final int TYPE_ADD_DETAIL
ADD_DETAIL Type

See Also:
Constant Field Values

TYPE_UPDATE_DETAIL

public static final int TYPE_UPDATE_DETAIL
UPDATE_DETAIL Type

See Also:
Constant Field Values

TYPE_DELETE_DETAIL

public static final int TYPE_DELETE_DETAIL
UPDATE_DELETE_DETAIL Type

See Also:
Constant Field Values

TYPE_UPDATE_BACKEND_CONTACT_ID

public static final int TYPE_UPDATE_BACKEND_CONTACT_ID
UPDATE_BACKEND_CONTACT_ID Type

See Also:
Constant Field Values

TYPE_UPDATE_NAB_CONTACT_ID

public static final int TYPE_UPDATE_NAB_CONTACT_ID
UPDATE_NAB_CONTACT_ID Type

See Also:
Constant Field Values

TYPE_UPDATE_BACKEND_DETAIL_ID

public static final int TYPE_UPDATE_BACKEND_DETAIL_ID
UPDATE_BACKEND_DETAIL_ID Type

See Also:
Constant Field Values

TYPE_UPDATE_NAB_DETAIL_ID

public static final int TYPE_UPDATE_NAB_DETAIL_ID
UPDATE_NAB_DETAIL_ID Type

See Also:
Constant Field Values

FLAG_NONE

public static final int FLAG_NONE
None (null) flag

See Also:
Constant Field Values

ATTRIBUTE_PREFERRED

public static final java.lang.String ATTRIBUTE_PREFERRED
TODO: Needed?! PREFERRED literal attribute

See Also:
Constant Field Values

FLAG_PREFERRED

public static final int FLAG_PREFERRED
Preferred Flag

See Also:
Constant Field Values

ATTRIBUTE_HOME

public static final java.lang.String ATTRIBUTE_HOME
TODO: Needed?! HOME literal attribute

See Also:
Constant Field Values

FLAG_HOME

public static final int FLAG_HOME
HOME Flag

See Also:
Constant Field Values

ATTRIBUTE_CELL

public static final java.lang.String ATTRIBUTE_CELL
TODO: Needed?! CELL literal attribute

See Also:
Constant Field Values

FLAG_CELL

public static final int FLAG_CELL
CELL Flag

See Also:
Constant Field Values

ATTRIBUTE_WORK

public static final java.lang.String ATTRIBUTE_WORK
TODO: Needed?! WORK literal attribute

See Also:
Constant Field Values

FLAG_WORK

public static final int FLAG_WORK
WORK Flag

See Also:
Constant Field Values

ATTRIBUTE_BIRTHDAY

public static final java.lang.String ATTRIBUTE_BIRTHDAY
BIRTHDAY FLAG

See Also:
Constant Field Values

FLAG_BIRTHDAY

public static final int FLAG_BIRTHDAY
TODO: Needed?! BIRTHDAY Flag

See Also:
Constant Field Values

ATTRIBUTE_FAX

public static final java.lang.String ATTRIBUTE_FAX
TODO: Needed?! FAX literal attribute

See Also:
Constant Field Values

FLAG_FAX

public static final int FLAG_FAX
FAX flag

See Also:
Constant Field Values

FLAGS_HOME_CELL

public static final int FLAGS_HOME_CELL
HOME and CELL Flag combination for convenience purposes

See Also:
Constant Field Values

FLAGS_WORK_CELL

public static final int FLAGS_WORK_CELL
WORK and CELL Flag combination for convenience purposes

See Also:
Constant Field Values

FLAGS_HOME_FAX

public static final int FLAGS_HOME_FAX
HOME and FAX Flag combination for convenience purposes

See Also:
Constant Field Values

FLAGS_WORK_FAX

public static final int FLAGS_WORK_FAX
WORK and FAX Flag combination for convenience purposes

See Also:
Constant Field Values

KEY_UNKNOWN

public static final int KEY_UNKNOWN
UNKNOWN Key

See Also:
Constant Field Values

KEY_VCARD_NAME

public static final int KEY_VCARD_NAME
NAME Key

See Also:
Constant Field Values

KEY_VCARD_NICKNAME

public static final int KEY_VCARD_NICKNAME
NICKNAME Key

See Also:
Constant Field Values

KEY_VCARD_DATE

public static final int KEY_VCARD_DATE
DATE Key

See Also:
Constant Field Values

KEY_VCARD_EMAIL

public static final int KEY_VCARD_EMAIL
EMAIL Key

See Also:
Constant Field Values

KEY_VCARD_PHONE

public static final int KEY_VCARD_PHONE
PHONE Key

See Also:
Constant Field Values

KEY_VCARD_ADDRESS

public static final int KEY_VCARD_ADDRESS
ADDRESS Key

See Also:
Constant Field Values

KEY_VCARD_URL

public static final int KEY_VCARD_URL
URL Key

See Also:
Constant Field Values

KEY_VCARD_INTERNET_ADDRESS

public static final int KEY_VCARD_INTERNET_ADDRESS
INTERNET_ADDRESS Key

See Also:
Constant Field Values

KEY_VCARD_IMADDRESS

public static final int KEY_VCARD_IMADDRESS
IM_ADDRESS Key

See Also:
Constant Field Values

KEY_VCARD_ROLE

public static final int KEY_VCARD_ROLE
ROLE Key

See Also:
Constant Field Values

KEY_VCARD_ORG

public static final int KEY_VCARD_ORG
ORG Key

See Also:
Constant Field Values

KEY_VCARD_TITLE

public static final int KEY_VCARD_TITLE
TITLE Key

See Also:
Constant Field Values

KEY_VCARD_NOTE

public static final int KEY_VCARD_NOTE
NOTE Key

See Also:
Constant Field Values

KEY_VCARD_BUSINESS

public static final int KEY_VCARD_BUSINESS
BUSINESS Key

See Also:
Constant Field Values

KEY_PRESENCE_TEXT

public static final int KEY_PRESENCE_TEXT
PRESENCE_TEXT Key

See Also:
Constant Field Values

KEY_PHOTO

public static final int KEY_PHOTO
PHOTO Key

See Also:
Constant Field Values

KEY_LOCATION

public static final int KEY_LOCATION
LOCATION Key

See Also:
Constant Field Values

KEY_GENDER

public static final int KEY_GENDER
GENDER Key

See Also:
Constant Field Values

KEY_RELATION

public static final int KEY_RELATION
RELATION Key

See Also:
Constant Field Values

KEY_BOOKMARK

public static final int KEY_BOOKMARK
BOOKMARK Key

See Also:
Constant Field Values

KEY_INTEREST

public static final int KEY_INTEREST
INTEREST Key

See Also:
Constant Field Values

KEY_FOLDER

public static final int KEY_FOLDER
FOLDER Key

See Also:
Constant Field Values

KEY_GROUP

public static final int KEY_GROUP
GROUP Key

See Also:
Constant Field Values

KEY_LINK

public static final int KEY_LINK
LINK Key

See Also:
Constant Field Values

KEY_EXTERNAL

public static final int KEY_EXTERNAL
EXTERNAL Key

See Also:
Constant Field Values

DESTINATION_FLAG_NONE

public static final int DESTINATION_FLAG_NONE
None (null) destination

See Also:
Constant Field Values

DESTINATION_FLAG_NAB

public static final int DESTINATION_FLAG_NAB
NAB destination

See Also:
Constant Field Values

DESTINATION_FLAG_CAB

public static final int DESTINATION_FLAG_CAB
CAB destination

See Also:
Constant Field Values

DESTINATION_FLAG_RPG

public static final int DESTINATION_FLAG_RPG
RPG destination

See Also:
Constant Field Values

DESTINATIONS_CAB_NAB

public static final int DESTINATIONS_CAB_NAB
Incoming via RPG. Goes to CAB first.

See Also:
Constant Field Values

DESTINATIONS_CAB_RPG

public static final int DESTINATIONS_CAB_RPG
Incoming via NAB. Goes to CAB first.

See Also:
Constant Field Values

DESTINATIONS_CAB_NAB_RPG

public static final int DESTINATIONS_CAB_NAB_RPG
Incoming via client. Goes to CAB first.

See Also:
Constant Field Values

sIntToKeyLookupTable

private static final java.lang.String[] sIntToKeyLookupTable
Lookup Table from Key integer to String values


sKeyToIntMap

private static final java.util.HashMap<java.lang.String,java.lang.Integer> sKeyToIntMap
Hashmap from Key String to integer values


INVALID_ID

public static final long INVALID_ID
Invalid ID value applicable to any ID within this class

See Also:
Constant Field Values

mDestinations

private int mDestinations
Destination flags for this ContactChange


mKey

private int mKey
Key for this ContactChange


mFlags

private int mFlags
Flags for this ContactChange


mValue

private final java.lang.String mValue
Value for this ContactChange


mType

private int mType
Type for this ContactChange


mInternalContactId

private long mInternalContactId
Internal Contact ID for this ContactChange


mInternalDetailId

private long mInternalDetailId
Internal Detail ID for this ContactChange


mBackendContactId

private long mBackendContactId
Backend Contact ID for this ContactChange


mBackendDetailId

private long mBackendDetailId
Backend Detail ID for this ContactChange


mNabContactId

private long mNabContactId
NAB Contact ID for this ContactChange


mNabDetailId

private long mNabDetailId
NAB Detail ID for this ContactChange

Constructor Detail

ContactChange

public ContactChange()
Default constructor


ContactChange

public ContactChange(int type)
Constructor taking the change type

Parameters:
type - The Change Type

ContactChange

public ContactChange(long nabContactId)
Constructor taking a nabContactId

Parameters:
nabContactId - Native Contact ID

ContactChange

public ContactChange(long nabContactId,
                     long nabDetailId)
Constructor taking a nabContactId and a nabDetailId

Parameters:
nabContactId - Native Contact ID
nabDetailId - Native Detail ID

ContactChange

public ContactChange(int destinations,
                     int type)
Constructor taking destination flags and a type

Parameters:
destinations - The destination flags
type - The change type

ContactChange

public ContactChange(int key,
                     java.lang.String value,
                     int flags)
Constructor taking key, value and flags

Parameters:
key - The Key for the Change
value - The Value for the Change
flags - The Flags for the Change
Method Detail

createIdsChange

public static ContactChange createIdsChange(ContactChange cc,
                                            int type)
Creates a shallow copy of a change. The copy contains the Contact IDs of the original and the supplied type

Parameters:
cc - The original Contact Change
type - The new type
Returns:
The shallow copy containing the IDs and Change type

copyWithNewValue

public ContactChange copyWithNewValue(java.lang.String newValue)
Creates a copy of the ContactChange with a modified value.

Parameters:
newValue - the new value to set
Returns:
a copy of the ContactChange with a new value

getDestinations

public int getDestinations()
Get the change destination flags.

Returns:
The Destination flags

setDestinations

public void setDestinations(int destinations)
Set the change destination flags.

Parameters:
destinations - The Destination flags to set

getKey

public int getKey()
Get the change Key.

Returns:
The change Key

getKeyToString

public java.lang.String getKeyToString()
Get the change Key String value.

Returns:
The Key String value for this change

getValue

public java.lang.String getValue()
Get the change value

Returns:
The change value

getType

public int getType()
Get the change type.

Returns:
The change value.

setType

public void setType(int type)
Set the type of change.

Parameters:
type - The type to set

setFlags

public void setFlags(int flags)
Set the change flags.

Parameters:
flags - The flags to set

getFlags

public int getFlags()
Get the change flags.

Returns:
The change flags

setKey

public void setKey(int key)
Sets the key.

Parameters:
key - The key to set

getInternalContactId

public long getInternalContactId()
Get the change's Internal Contact ID.

Returns:
The Internal Contact ID

setInternalContactId

public void setInternalContactId(long internalContactId)
Set the change's Internal Contact ID.

Parameters:
The - Internal Contact ID to set

getInternalDetailId

public long getInternalDetailId()
Get the change's Internal Detail ID.

Returns:
The Internal Detail ID

setInternalDetailId

public void setInternalDetailId(long internalDetailId)
Set the change's Internal Detail ID.

Parameters:
The - Internal Detail ID to set

getBackendContactId

public long getBackendContactId()
Get the change's Backend Contact ID.

Returns:
The Backend Contact ID

setBackendContactId

public void setBackendContactId(long backendContactId)
Set the change's Backend Contact ID.

Parameters:
The - Backend Contact ID to set

getBackendDetailId

public long getBackendDetailId()
Get the change's Backend Detail ID.

Returns:
The Backend Detail ID

setBackendDetailId

public void setBackendDetailId(long backendDetailId)
Set the change's Backend Detail ID.

Parameters:
The - Backend Detail ID to set

getNabContactId

public long getNabContactId()
Get the change's NAB Contact ID.

Returns:
The NAB Contact ID

setNabContactId

public void setNabContactId(long nabContactId)
Set the change's NAB Contact ID.

Parameters:
The - NAB Contact ID to set

getNabDetailId

public long getNabDetailId()
Get the change's NAB Detail ID.

Returns:
The NAB Detail ID

setNabDetailId

public void setNabDetailId(long nabDetailId)
Set the change's NAB Detail ID.

Parameters:
The - NAB Detail ID


JavaDoc