Module it.auties.cobalt
Record Class ContactsMessage
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.standard.ContactsMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,ContextualMessage,Message
public record ContactsMessage(String name, List<ContactMessage> contacts, Optional<ContextInfo> contextInfo)
extends Record
implements ContextualMessage
A model class that represents a message holding a list of contacts inside
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ContactMessage> The field for thecontactsrecord component.private final Optional<ContextInfo> The field for thecontextInforecord component.private final StringThe field for thenamerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionContactsMessage(String name, List<ContactMessage> contacts, Optional<ContextInfo> contextInfo) Creates an instance of aContactsMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Return message categorycontacts()Returns the value of thecontactsrecord component.Returns 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 type
-
Field Details
-
name
The field for thenamerecord component. -
contacts
The field for thecontactsrecord component. -
contextInfo
The field for thecontextInforecord component.
-
-
Constructor Details
-
ContactsMessage
public ContactsMessage(String name, List<ContactMessage> contacts, Optional<ContextInfo> contextInfo) Creates an instance of aContactsMessagerecord class.- Parameters:
name- the value for thenamerecord componentcontacts- the value for thecontactsrecord 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
-
contacts
Returns the value of thecontactsrecord component.- Returns:
- the value of the
contactsrecord component
-
contextInfo
Returns the value of thecontextInforecord component.- Specified by:
contextInfoin interfaceContextualMessage- Returns:
- the value of the
contextInforecord component
-