Package com.vonage.client.sms.messages
Class TextMessage
java.lang.Object
com.vonage.client.sms.messages.Message
com.vonage.client.sms.messages.TextMessage
- All Implemented Interfaces:
QueryParamsRequest
Represents the details of a plain-text message that is to be submitted via the Vonage REST api.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vonage.client.sms.messages.Message
Message.MessageClass, Message.MessageType -
Constructor Summary
ConstructorsConstructorDescriptionTextMessage(String from, String to, String messageBody) Instantiate a new text-message request.
This message will be submitted as a regular 8 bit text messageTextMessage(String from, String to, String messageBody, boolean unicode) Instantiate a new text-message request.
This message will be submitted as a regular 8 bit text message -
Method Summary
Modifier and TypeMethodDescriptionbooleanInternal method for serializing the fields of this class into query parameters.Methods inherited from class com.vonage.client.sms.messages.Message
getCallbackUrl, getClientReference, getContentId, getEntityId, getFrom, getMessageClass, getStatusReportRequired, getTimeToLive, getTo, getType, setCallbackUrl, setClientReference, setContentId, setEntityId, setMessageClass, setStatusReportRequired, setTimeToLive
-
Constructor Details
-
TextMessage
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 tomessageBody- The text of the message to be sent to the handset
-
TextMessage
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 tomessageBody- The text of the message to be sent to the handsetunicode- set this flag to true if the message needs to be submitted as a unicode message
-
-
Method Details
-
getMessageBody
- Returns:
- String The text of the message to be sent to the handset
-
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.
-
makeParams
Description copied from interface:QueryParamsRequestInternal method for serializing the fields of this class into query parameters. The Map should be mutable so that subclasses can add fields, otherwise the method or implementing class should be marked asfinal. Duplicate entries can be handled by mapping the key to a list of the entries.- Specified by:
makeParamsin interfaceQueryParamsRequest- Overrides:
makeParamsin classMessage- Returns:
- The query parameters as unique key-value pairs.
-