Module it.auties.cobalt
Record Class ProductMessage
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.message.standard.ProductMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,ButtonMessage,ContextualMessage,Message
public record ProductMessage(Product product, Jid businessOwnerJid, ProductCatalog catalog, Optional<String> body, Optional<String> footer, Optional<ContextInfo> contextInfo)
extends Record
implements ContextualMessage, ButtonMessage
A model class that represents a message holding a product inside
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thebodyrecord component.private final JidThe field for thebusinessOwnerJidrecord component.private final ProductCatalogThe field for thecatalogrecord component.private final Optional<ContextInfo> The field for thecontextInforecord component.The field for thefooterrecord component.private final ProductThe field for theproductrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionProductMessage(Product product, Jid businessOwnerJid, ProductCatalog catalog, Optional<String> body, Optional<String> footer, Optional<ContextInfo> contextInfo) Creates an instance of aProductMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.Returns the value of thebusinessOwnerJidrecord component.catalog()Returns the value of thecatalogrecord component.category()Return message categoryReturns the value of thecontextInforecord component.final booleanIndicates whether some other object is "equal to" this one.footer()Returns the value of thefooterrecord component.final inthashCode()Returns a hash code value for this object.product()Returns the value of theproductrecord component.final StringtoString()Returns a string representation of this record class.type()Return message type
-
Field Details
-
product
The field for theproductrecord component. -
businessOwnerJid
The field for thebusinessOwnerJidrecord component. -
catalog
The field for thecatalogrecord component. -
body
The field for thebodyrecord component. -
contextInfo
The field for thecontextInforecord component.
-
-
Constructor Details
-
ProductMessage
public ProductMessage(Product product, Jid businessOwnerJid, ProductCatalog catalog, Optional<String> body, Optional<String> footer, Optional<ContextInfo> contextInfo) Creates an instance of aProductMessagerecord class.- Parameters:
product- the value for theproductrecord componentbusinessOwnerJid- the value for thebusinessOwnerJidrecord componentcatalog- the value for thecatalogrecord componentbody- the value for thebodyrecord componentfooter- the value for thefooterrecord componentcontextInfo- the value for thecontextInforecord component
-
-
Method Details
-
type
Description copied from interface:MessageReturn message type -
category
Description copied from interface:MessageReturn message category- Specified by:
categoryin interfaceButtonMessage- Specified by:
categoryin interfaceMessage- Returns:
- a non-null 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). -
product
Returns the value of theproductrecord component.- Returns:
- the value of the
productrecord component
-
businessOwnerJid
Returns the value of thebusinessOwnerJidrecord component.- Returns:
- the value of the
businessOwnerJidrecord component
-
catalog
Returns the value of thecatalogrecord component.- Returns:
- the value of the
catalogrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
contextInfo
Returns the value of thecontextInforecord component.- Specified by:
contextInfoin interfaceContextualMessage- Returns:
- the value of the
contextInforecord component
-