Module it.auties.cobalt
Record Class HighlyStructuredButtonTemplate
java.lang.Object
java.lang.Record
it.auties.whatsapp.model.button.template.hsm.HighlyStructuredButtonTemplate
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject
public record HighlyStructuredButtonTemplate(Optional<HighlyStructuredQuickReplyButton> highlyStructuredQuickReplyButton, Optional<HighlyStructuredURLButton> highlyStructuredUrlButton, Optional<HighlyStructuredCallButton> highlyStructuredCallButton, int index)
extends Record
implements it.auties.protobuf.model.ProtobufMessage
A model class that represents a template for a button
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<HighlyStructuredCallButton> The field for thehighlyStructuredCallButtonrecord component.private final Optional<HighlyStructuredQuickReplyButton> The field for thehighlyStructuredQuickReplyButtonrecord component.private final Optional<HighlyStructuredURLButton> The field for thehighlyStructuredUrlButtonrecord component.private final intThe field for theindexrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionHighlyStructuredButtonTemplate(Optional<HighlyStructuredQuickReplyButton> highlyStructuredQuickReplyButton, Optional<HighlyStructuredURLButton> highlyStructuredUrlButton, Optional<HighlyStructuredCallButton> highlyStructuredCallButton, int index) Creates an instance of aHighlyStructuredButtonTemplaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionOptional<? extends HighlyStructuredButton> button()Returns this buttonReturns the type of button that this message wrapsfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehighlyStructuredCallButtonrecord component.Returns the value of thehighlyStructuredQuickReplyButtonrecord component.Returns the value of thehighlyStructuredUrlButtonrecord component.intindex()Returns the value of theindexrecord component.of(int index, HighlyStructuredButton highlyStructuredButton) Constructs a new templateof(HighlyStructuredButton highlyStructuredButton) Constructs a new templatefinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
highlyStructuredQuickReplyButton
The field for thehighlyStructuredQuickReplyButtonrecord component. -
highlyStructuredUrlButton
The field for thehighlyStructuredUrlButtonrecord component. -
highlyStructuredCallButton
The field for thehighlyStructuredCallButtonrecord component. -
index
private final int indexThe field for theindexrecord component.
-
-
Constructor Details
-
HighlyStructuredButtonTemplate
public HighlyStructuredButtonTemplate(Optional<HighlyStructuredQuickReplyButton> highlyStructuredQuickReplyButton, Optional<HighlyStructuredURLButton> highlyStructuredUrlButton, Optional<HighlyStructuredCallButton> highlyStructuredCallButton, int index) Creates an instance of aHighlyStructuredButtonTemplaterecord class.- Parameters:
highlyStructuredQuickReplyButton- the value for thehighlyStructuredQuickReplyButtonrecord componenthighlyStructuredUrlButton- the value for thehighlyStructuredUrlButtonrecord componenthighlyStructuredCallButton- the value for thehighlyStructuredCallButtonrecord componentindex- the value for theindexrecord component
-
-
Method Details
-
of
Constructs a new template- Parameters:
highlyStructuredButton- the button- Returns:
- a non-null button template
-
of
public static HighlyStructuredButtonTemplate of(int index, HighlyStructuredButton highlyStructuredButton) Constructs a new template- Parameters:
index- the indexhighlyStructuredButton- the button- Returns:
- a non-null button template
-
button
Returns this button- Returns:
- a non-null optional
-
buttonType
Returns the type of button that this message wraps- Returns:
- a non-null button type
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
highlyStructuredQuickReplyButton
Returns the value of thehighlyStructuredQuickReplyButtonrecord component.- Returns:
- the value of the
highlyStructuredQuickReplyButtonrecord component
-
highlyStructuredUrlButton
Returns the value of thehighlyStructuredUrlButtonrecord component.- Returns:
- the value of the
highlyStructuredUrlButtonrecord component
-
highlyStructuredCallButton
Returns the value of thehighlyStructuredCallButtonrecord component.- Returns:
- the value of the
highlyStructuredCallButtonrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-