Class Message.MessageBuilder

java.lang.Object
com.whatsapp.api.domain.messages.Message.MessageBuilder
Enclosing class:
Message

public static class Message.MessageBuilder extends Object
The type Message builder.
  • Method Details

    • builder

      public static Message.MessageBuilder builder()
      Builder message builder.
      Returns:
      the message builder
    • setTo

      public Message.MessageBuilder setTo(String to)
      Sets to.
      Parameters:
      to - Required.

      WhatsApp ID or phone number for the person you want to send a message to.

      Returns:
      the to
    • setContext

      public Message.MessageBuilder setContext(Context context)
      Sets context.
      Parameters:
      context - . the messsage's context.
      Returns:
      the context
    • buildTextMessage

      public Message buildTextMessage(TextMessage textMessage)
      Build a text objetc, with:
      • body required
      • preview_url optional
      Parameters:
      textMessage - : TextMessage object.
      Returns:
      the message
    • buildContactMessage

      public Message buildContactMessage(ContactMessage contactMessage)
      Required. Build an objetc with Contact
      Parameters:
      contactMessage - the contact message
      Returns:
      the message
      See Also:
    • buildTemplateMessage

      public Message buildTemplateMessage(TemplateMessage templateMessage)
      Build template message
      Parameters:
      templateMessage - the template message
      Returns:
      the message
      See Also:
    • buildInteractiveMessage

      public Message buildInteractiveMessage(InteractiveMessage interactiveMessage)
      Build an object to send an InteractiveMessage
      Parameters:
      interactiveMessage - the interactive message
      Returns:
      the message
      See Also:
    • buildAudioMessage

      public Message buildAudioMessage(AudioMessage audioMessage)
      Build audio message
      Parameters:
      audioMessage - the audio message
      Returns:
      the message
      See Also:
    • buildDocumentMessage

      public Message buildDocumentMessage(DocumentMessage documentMessage)
      Build document message
      Parameters:
      documentMessage - the document message
      Returns:
      the message
      See Also:
    • buildImageMessage

      public Message buildImageMessage(ImageMessage imageMessage)
      Build image message
      Parameters:
      imageMessage - the image message
      Returns:
      the message
      See Also:
    • buildStickerMessage

      public Message buildStickerMessage(StickerMessage stickerMessage)
      Build sticker message
      Parameters:
      stickerMessage - the sticker message
      Returns:
      the message
      See Also:
    • buildVideoMessage

      public Message buildVideoMessage(VideoMessage videoMessage)
      Build video message
      Parameters:
      videoMessage - the video message
      Returns:
      the message
      See Also:
    • buildReactionMessage

      public Message buildReactionMessage(ReactionMessage reactionMessage)
      Build reaction message
      Parameters:
      reactionMessage - the reaction message
      Returns:
      the message
      See Also:
    • buildLocationMessage

      public Message buildLocationMessage(LocationMessage locationMessage)
      Build location message
      Parameters:
      locationMessage - the location message
      Returns:
      the message
      See Also: