@DoNotImplement public interface MqttUtf8String extends Comparable<MqttUtf8String>
MUST requirements: An UTF-8 encoded string
SHOULD requirements: An UTF-8 encoded string
Modifier and Type | Method and Description |
---|---|
boolean |
containsShouldNotCharacters()
Checks whether this UTF-8 encoded string contains characters that it should not according to the MQTT
specification.
|
static @NotNull MqttUtf8String |
of(@NotNull String string)
Validates and creates an UTF-8 encoded string of the given Java string.
|
@NotNull ByteBuffer |
toByteBuffer()
Returns the UTF-8 encoded representation as a read-only byte buffer.
|
compareTo
@NotNull static @NotNull MqttUtf8String of(@NotNull @NotNull String string)
string
- the string representation of the UTF-8 encoded string.IllegalArgumentException
- if the string is not a valid UTF-8 encoded string.boolean containsShouldNotCharacters()
These characters are control characters (U+0001..U+001F, U+007F..U+009F) and non-characters.
@NotNull @NotNull ByteBuffer toByteBuffer()