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 thecontextInfo
record component.private final String
The field for thename
record component.private final ContactCard
The field for thevcard
record component. -
Constructor Summary
ConstructorsConstructorDescriptionContactMessage
(String name, ContactCard vcard, Optional<ContextInfo> contextInfo) Creates an instance of aContactMessage
record class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()
Return message categoryReturns the value of thecontextInfo
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.type()
Return message typevcard()
Returns the value of thevcard
record component.
-
Field Details
-
name
The field for thename
record component. -
vcard
The field for thevcard
record component. -
contextInfo
The field for thecontextInfo
record component.
-
-
Constructor Details
-
ContactMessage
Creates an instance of aContactMessage
record class.- Parameters:
name
- the value for thename
record componentvcard
- the value for thevcard
record componentcontextInfo
- the value for thecontextInfo
record component
-
-
Method Details
-
type
Description copied from interface:Message
Return message type -
category
Description copied from interface:Message
Return 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 thename
record component.- Returns:
- the value of the
name
record component
-
vcard
Returns the value of thevcard
record component.- Returns:
- the value of the
vcard
record component
-
contextInfo
Returns the value of thecontextInfo
record component.- Specified by:
contextInfo
in interfaceContextualMessage
- Returns:
- the value of the
contextInfo
record component
-