Class TextMessage
java.lang.Object
org.apache.pekko.http.javadsl.model.ws.Message
org.apache.pekko.http.javadsl.model.ws.TextMessage
- Direct Known Subclasses:
- TextMessage.Streamed,- TextMessage.Strict
Represents a WebSocket text message. A text message can either be strict in which case
 the complete data is already available or it can be streamed in which case 
getStreamedText()
 will return a Source streaming the data as it comes in.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic TextMessageadapt(TextMessage msg) Returns this BinaryMessage if it is a binary message, throws otherwise.abstract TextMessageasScala()Returns this TextMessage if it is a text message, throws otherwise.static TextMessageCreates a strict text message.static TextMessageCreates a streamed text message.abstract org.apache.pekko.stream.javadsl.Source<String,?> Returns a source of the text message data.abstract StringReturns the strict message text if this message is strict, throws otherwise.booleanisText()Is this message a text message?abstract CompletionStage<TextMessage.Strict>toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer) 
- 
Constructor Details- 
TextMessagepublic TextMessage()
 
- 
- 
Method Details- 
createCreates a strict text message.- Parameters:
- text- (undocumented)
- Returns:
- (undocumented)
 
- 
createCreates a streamed text message.- Parameters:
- textStream- (undocumented)
- Returns:
- (undocumented)
 
- 
adapt
- 
getStreamedTextReturns a source of the text message data.- Returns:
- (undocumented)
 
- 
getStrictTextReturns the strict message text if this message is strict, throws otherwise.- Returns:
- (undocumented)
 
- 
isTextpublic boolean isText()Description copied from class:MessageIs this message a text message? If true,Message.asTextMessage()will return this text message, if false,Message.asBinaryMessage()will return this binary message.
- 
asTextMessageDescription copied from class:MessageReturns this TextMessage if it is a text message, throws otherwise.- Specified by:
- asTextMessagein class- Message
- Returns:
- (undocumented)
 
- 
asBinaryMessageDescription copied from class:MessageReturns this BinaryMessage if it is a binary message, throws otherwise.- Specified by:
- asBinaryMessagein class- Message
- Returns:
- (undocumented)
 
- 
asScala
- 
toStrictpublic abstract CompletionStage<TextMessage.Strict> toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer) 
 
-