Module it.auties.cobalt
Record Class ContactMessage
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.standard.ContactMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,ContextualMessage,Message
public record ContactMessage(String name, ContactCard vcard, Optional<ContextInfo> contextInfo)
extends Record
implements ContextualMessage
A model class that represents a message holding a contact inside
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<ContextInfo> The field for thecontextInforecord component.private final StringThe field for thenamerecord component.private final ContactCardThe field for thevcardrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionContactMessage(String name, ContactCard vcard, Optional<ContextInfo> contextInfo) Creates an instance of aContactMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Return message categoryReturns the value of thecontextInforecord 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.final StringtoString()Returns a string representation of this record class.type()Return message typevcard()Returns the value of thevcardrecord component.
-
Field Details
-
name
The field for thenamerecord component. -
vcard
The field for thevcardrecord component. -
contextInfo
The field for thecontextInforecord component.
-
-
Constructor Details
-
ContactMessage
Creates an instance of aContactMessagerecord class.- Parameters:
name- the value for thenamerecord componentvcard- the value for thevcardrecord componentcontextInfo- the value for thecontextInforecord component
-
-
Method Details
-
type
Description copied from interface:MessageReturn message type -
category
Description copied from interface:MessageReturn message category -
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
vcard
Returns the value of thevcardrecord component.- Returns:
- the value of the
vcardrecord component
-
contextInfo
Returns the value of thecontextInforecord component.- Specified by:
contextInfoin interfaceContextualMessage- Returns:
- the value of the
contextInforecord component
-