Class ContactCard

java.lang.Object
it.auties.whatsapp.model.contact.ContactCard
All Implemented Interfaces:
it.auties.protobuf.base.ProtobufMessage

public final class ContactCard extends Object implements it.auties.protobuf.base.ProtobufMessage
A model class to represent and build the vcard of a contact
  • Method Details

    • of

      public static ContactCard of(@NonNull @NonNull String vcard)
      Parses a vcard
      Parameters:
      vcard - the non-null vcard to parse
      Returns:
      a non-null vcard
    • convert

      public static ContactCard convert(Object input)
    • version

      public Optional<String> version()
      Returns the version of this card if defined
      Returns:
      an optional
    • name

      public Optional<String> name()
      Returns the name of this card if defined
      Returns:
      an optional
    • businessName

      public Optional<String> businessName()
      Returns the business name of this card if defined
      Returns:
      an optional
    • toVcard

      public String toVcard()
      Converts this object in a valid vcard
      Returns:
      a non-null String
    • toString

      public String toString()
      Converts this object in a valid vcard
      Overrides:
      toString in class Object
      Returns:
      a non-null String
    • toValue

      public Object toValue()
      Converts this object in a valid vcard
      Specified by:
      toValue in interface it.auties.protobuf.base.ProtobufMessage
      Returns:
      a non-null String
    • isValueBased

      public boolean isValueBased()
      Specified by:
      isValueBased in interface it.auties.protobuf.base.ProtobufMessage
    • builder

      public static ContactCard.ContactCardBuilder builder()
    • phoneNumbers

      @NonNull public @NonNull Map<String,ContactJid> phoneNumbers()
      The phone numbers, ordered by type
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • of

      public static ContactCard of(String version, String name, @NonNull @NonNull Map<String,ContactJid> phoneNumbers, String businessName)