- self._contactId = contactId
- self._phoneNumber = phoneNumber
-
- @staticmethod
- def from_handle_name(handleName):
- parts = handleName.split("#", 1)
- if len(parts) == 2:
- contactId, contactNumber = parts[0:2]
- elif len(parts) == 1:
- contactId, contactNumber = "", handleName
- else:
- raise RuntimeError("Invalid handle: %s" % handleName)
-
- contactNumber = strip_number(contactNumber)
- return contactId, contactNumber
-
- @staticmethod
- def to_handle_name(contactId, contactNumber):
- handleName = "#".join((contactId, strip_number(contactNumber)))
- return handleName
-
- @property
- def contactID(self):
- return self._contactId
-