Class TextMessage


  • public class TextMessage
    extends Message
    Represents the details of a plain-text message that is to be submitted via the Nexmo REST api.
    • Constructor Detail

      • TextMessage

        public TextMessage​(java.lang.String from,
                           java.lang.String to,
                           java.lang.String messageBody)
        Instantiate a new text-message request.
        This message will be submitted as a regular 8 bit text message
        Parameters:
        from - the 'from' address that will be seen on the handset when this message arrives, typically either a valid short-code / long code that can be replied to, or a short text description of the application sending the message (Max 11 chars)
        to - the phone number of the handset that you wish to send the message to
        messageBody - The text of the message to be sent to the handset
      • TextMessage

        public TextMessage​(java.lang.String from,
                           java.lang.String to,
                           java.lang.String messageBody,
                           boolean unicode)
        Instantiate a new text-message request.
        This message will be submitted as a regular 8 bit text message
        Parameters:
        from - the 'from' address that will be seen on the handset when this message arrives, typically either a valid short-code / long code that can be replied to, or a short text description of the application sending the message (Max 11 chars)
        to - the phone number of the handset that you wish to send the message to
        messageBody - The text of the message to be sent to the handset
    • Method Detail

      • getMessageBody

        public java.lang.String getMessageBody()
        Returns:
        String The text of the message to be sent to the handset
      • isUnicode

        public boolean isUnicode()
        Returns:
        boolean This flag is set to true if the message needs to be submitted as a unicode message. This would be for scenario's where the message contains text that does not fit within the Latin GSM alphabet. Examples would be messages to be sent in non-western scripts, such as Arabic, Kanji, Chinese, etc.
      • getType

        public Message.MessageType getType()
        Overrides:
        getType in class Message
        Returns:
        int the type of message will influence the makeup of the request we post to the Nexmo server, and also the action taken by the Nexmo server in response to this message
      • addParams

        public void addParams​(org.apache.http.client.methods.RequestBuilder request)
        Overrides:
        addParams in class Message