Interface ContactCard

All Known Implementing Classes:
ContactCard.Parsed, ContactCard.Raw

public sealed interface ContactCard permits ContactCard.Parsed, ContactCard.Raw
A model class to represent and build the vcard of a contact
  • Method Details

    • ofNullable

      static ContactCard ofNullable(String vcard)
    • of

      static ContactCard of(String vcard)
      Parses a vcard If the vCard dependency wasn't included, or a parsing error occurs, a raw representation is returned
      Parameters:
      vcard - the non-null vcard to parse
      Returns:
      a non-null vcard
    • of

      static ContactCard of(String name, Jid phoneNumber)
      Creates a new vcard
      Parameters:
      name - the nullable name of the contact
      phoneNumber - the non-null phone number of the contact
      Returns:
      a vcard
    • of

      static ContactCard of(String name, Jid phoneNumber, String businessName)
      Creates a new vcard
      Parameters:
      name - the nullable name of the contact
      phoneNumber - the non-null phone number of the contact
      businessName - the nullable business name of the contact
      Returns:
      a vcard
    • isValidPhoneNumber

      private static boolean isValidPhoneNumber(ezvcard.property.Telephone entry)
    • getPhoneType

      private static String getPhoneType(ezvcard.property.Telephone entry)
    • getPhoneValue

      private static List<Jid> getPhoneValue(ezvcard.property.Telephone entry)
    • joinPhoneNumbers

      private static List<Jid> joinPhoneNumbers(List<Jid> first, List<Jid> second)
    • toVcard

      String toVcard()