public abstract class TextMessage extends Message
getStreamedText
will return a Source streaming the data as it comes in.Constructor and Description |
---|
TextMessage() |
Modifier and Type | Method and Description |
---|---|
static TextMessage |
adapt(TextMessage msg) |
BinaryMessage |
asBinaryMessage()
Returns this BinaryMessage if it is a binary message, throws otherwise.
|
abstract TextMessage |
asScala() |
TextMessage |
asTextMessage()
Returns this TextMessage if it is a text message, throws otherwise.
|
static TextMessage |
create(org.apache.pekko.stream.javadsl.Source<java.lang.String,?> textStream)
Creates a streamed text message.
|
static TextMessage |
create(java.lang.String text)
Creates a strict text message.
|
abstract org.apache.pekko.stream.javadsl.Source<java.lang.String,?> |
getStreamedText()
Returns a source of the text message data.
|
abstract java.lang.String |
getStrictText()
Returns the strict message text if this message is strict, throws otherwise.
|
boolean |
isText()
Is this message a text message?
|
abstract java.util.concurrent.CompletionStage<TextMessage.Strict> |
toStrict(long timeoutMillis,
org.apache.pekko.stream.Materializer materializer) |
public static TextMessage create(java.lang.String text)
text
- (undocumented)public static TextMessage create(org.apache.pekko.stream.javadsl.Source<java.lang.String,?> textStream)
textStream
- (undocumented)public static TextMessage adapt(TextMessage msg)
public abstract org.apache.pekko.stream.javadsl.Source<java.lang.String,?> getStreamedText()
public abstract java.lang.String getStrictText()
public boolean isText()
Message
asTextMessage
will return this
text message, if false, asBinaryMessage
will return this binary message.public TextMessage asTextMessage()
Message
asTextMessage
in class Message
public BinaryMessage asBinaryMessage()
Message
asBinaryMessage
in class Message
public abstract TextMessage asScala()
public abstract java.util.concurrent.CompletionStage<TextMessage.Strict> toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer)