java.lang.Object
java.lang.Record
it.auties.whatsapp.model.contact.ContactCard.Parsed
- All Implemented Interfaces:
ContactCard
- Enclosing interface:
ContactCard
public static record ContactCard.Parsed(String version, Optional<String> name, Map<String,List<Jid>> phoneNumbers, Optional<String> businessName)
extends Record
implements ContactCard
A parsed representation of the vcard
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.auties.whatsapp.model.contact.ContactCard
ContactCard.Parsed, ContactCard.Raw -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thebusinessNamerecord component.The field for thenamerecord component.The field for thephoneNumbersrecord component.private final StringThe field for theversionrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddPhoneNumber(ezvcard.VCard vcard, String type, Jid contact) voidaddPhoneNumber(Jid contact) voidaddPhoneNumber(String category, Jid contact) Returns the value of thebusinessNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thephoneNumbersrecord component.final StringtoString()Returns a string representation of this record class.toVcard()Converts this object in a valid vcardversion()Returns the value of theversionrecord component.
-
Field Details
-
version
The field for theversionrecord component. -
name
The field for thenamerecord component. -
phoneNumbers
The field for thephoneNumbersrecord component. -
businessName
The field for thebusinessNamerecord component.
-
-
Constructor Details
-
Parsed
public Parsed(String version, Optional<String> name, Map<String, List<Jid>> phoneNumbers, Optional<String> businessName) Creates an instance of aParsedrecord class.- Parameters:
version- the value for theversionrecord componentname- the value for thenamerecord componentphoneNumbers- the value for thephoneNumbersrecord componentbusinessName- the value for thebusinessNamerecord component
-
-
Method Details
-
defaultPhoneNumbers
-
addPhoneNumber
-
addPhoneNumber
-
addPhoneNumber
-
toVcard
Converts this object in a valid vcard- Specified by:
toVcardin interfaceContactCard- Returns:
- a non-null String
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
phoneNumbers
Returns the value of thephoneNumbersrecord component.- Returns:
- the value of the
phoneNumbersrecord component
-
businessName
Returns the value of thebusinessNamerecord component.- Returns:
- the value of the
businessNamerecord component
-