java.lang.Object
it.auties.whatsapp.model.contact.Contact
- All Implemented Interfaces:
JidProvider
A model class that represents a Contact. This class is only a model, this means that changing its
values will have no real effect on WhatsappWeb's servers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether this contact is blockedprivate StringThe nullable name specified by this contact when he created a Whatsapp account.private StringThe nullable name associated with this contact on the phone connected with Whatsappprivate final JidThe non-null unique jid used to identify this contactprivate ContactStatusThe nullable last known presence of this contact.private ZonedDateTimeThe nullable last seconds this contact was seen available.private StringThe nullable short name associated with this contact on the phone connected with Whatsapp If a name is available, theoretically, also a short name should be -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanblocked()booleanfullName()inthashCode()jid()lastSeen()(package private) Longname()setBlocked(boolean blocked) setChosenName(String chosenName) setFullName(String fullName) setLastKnownPresence(ContactStatus lastKnownPresence) setLastSeen(ZonedDateTime lastSeen) setShortName(String shortName) toJid()Returns this object as a jid
-
Field Details
-
jid
The non-null unique jid used to identify this contact -
chosenName
The nullable name specified by this contact when he created a Whatsapp account. Theoretically, it should not be possible for this field to be null as it's required when registering for Whatsapp. Though it looks that it can be removed later, so it's nullable. -
fullName
The nullable name associated with this contact on the phone connected with Whatsapp -
shortName
The nullable short name associated with this contact on the phone connected with Whatsapp If a name is available, theoretically, also a short name should be -
lastKnownPresence
The nullable last known presence of this contact. This field is associated only with the presence of this contact in the corresponding conversation. If, for example, this contact is composing, recording or paused in a group this field will not be affected. Instead,Chat.presences()should be used. By default, Whatsapp will not send updates about a contact's status unless they send a message or are in the recent contacts. To force Whatsapp to send updates, useWhatsapp.subscribeToPresence(JidProvider). -
lastSeen
The nullable last seconds this contact was seen available. Any contact can decide to hide this information in their privacy settings. -
blocked
private boolean blockedWhether this contact is blocked
-
-
Constructor Details
-
Contact
-
Contact
-
-
Method Details
-
jid
-
name
-
lastSeen
-
chosenName
-
fullName
-
shortName
-
lastKnownPresence
-
blocked
public boolean blocked() -
setChosenName
-
setFullName
-
setShortName
-
setLastKnownPresence
-
setLastSeen
-
setBlocked
-
lastSeenValue
Long lastSeenValue() -
hashCode
public int hashCode() -
equals
-
toJid
Description copied from interface:JidProviderReturns this object as a jid- Specified by:
toJidin interfaceJidProvider- Returns:
- a non-null jid
-