Class EntityAttrPhone

java.lang.Object
ru.bgcrm.plugin.bgbilling.proto.model.entity.EntityAttr
ru.bgcrm.plugin.bgbilling.proto.model.entity.EntityAttrPhone

public class EntityAttrPhone extends EntityAttr
Attribute/parameter - phones. To get the phone list, use the getContactList(), toPhoneList(), toUnformattedPhoneList() methods
  • Constructor Details

    • EntityAttrPhone

      protected EntityAttrPhone()
    • EntityAttrPhone

      public EntityAttrPhone(int entityId, int entitySpecAttrId)
      Parameters:
      entityId - the contract/object/entity ID
      entitySpecAttrId - the parameter/attribute type ID
    • EntityAttrPhone

      public EntityAttrPhone(int entityId, int entitySpecAttrId, String phone, String comment)
  • Method Details

    • getContactList

      public List<EntityAttrPhone.PhoneContact> getContactList()
      Returns:
      the contact list
    • setContactList

      public void setContactList(List<EntityAttrPhone.PhoneContact> phoneList)
      Parameters:
      phoneList - the contact list
    • addContact

      public EntityAttrPhone addContact(String phone, String comment)
      Adds a phone (contact)
      Parameters:
      phone - the phone number
      comment - the comment
      Returns:
      this
    • getData

      public String getData()
    • setData

      public void setData(String data)
      For internal use. To add a phone, use addContact(String, String) or setContactList(List)
      Parameters:
      data - the raw data
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toPhoneList

      public List<String> toPhoneList()
      Returns:
      the formatted phone list
    • toUnformattedPhoneList

      public List<String> toUnformattedPhoneList()
      Returns:
      the unformatted phone list
    • phoneUnformatted

      public static String phoneUnformatted(String phone)
      Converts a formatted phone number into a set of digits
      Parameters:
      phone - +7 (347) 2 924-823
      Returns:
      73472924823