Class ButtonComponent

java.lang.Object
com.whatsapp.api.domain.messages.Component<ButtonComponent>
com.whatsapp.api.domain.messages.ButtonComponent

public class ButtonComponent extends Component<ButtonComponent>
The type Button component.
  • Constructor Details

    • ButtonComponent

      public ButtonComponent()
      Instantiates a new Button component.
    • ButtonComponent

      public ButtonComponent(int index, ButtonSubType subType)
      Instantiates a new Button component.
      Parameters:
      index - the index
      subType - the sub type
  • Method Details

    • getIndex

      public int getIndex()
      Gets index.
      Returns:
      the index
    • setIndex

      public ButtonComponent setIndex(int index)
      Sets index. Required when type=button. Not used for the other types. Only used for Cloud API. Position index of the button. You can have up to 3 buttons using index values of 0 to 2.
      Parameters:
      index - the index
      Returns:
      the index
    • getSubType

      public ButtonSubType getSubType()
      Gets sub type.
      Returns:
      the sub type
    • setSubType

      public ButtonComponent setSubType(ButtonSubType subType)
      Sets sub type. Required when type=button. Not used for the other types. Type of button to create.
      Parameters:
      subType - the sub type
      Returns:
      the sub type