Package com.hivemq.client.mqtt.datatypes
Interface MqttTopic
- All Superinterfaces:
Comparable<MqttUtf8String>,MqttUtf8String
MQTT Topic Name according to the MQTT specification.
A Topic Name has the same requirements as an UTF-8 encoded string. Additionally it
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe topic level separator character. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MqttTopicBuilderbuilder()Creates a builder for a Topic Name.extend()Creates a builder for extending this Topic Name.filter()Validates and creates a Topic Name of the given string.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.hivemq.client.mqtt.datatypes.MqttUtf8String
containsShouldNotCharacters, toByteBuffer
-
Field Details
-
TOPIC_LEVEL_SEPARATOR
static final char TOPIC_LEVEL_SEPARATORThe topic level separator character.- See Also:
-
-
Method Details
-
of
Validates and creates a Topic Name of the given string.- Parameters:
string- the string representation of the Topic Name.- Returns:
- the created Topic Name.
- Throws:
IllegalArgumentException- if the string is not a valid Topic Name.
-
builder
Creates a builder for a Topic Name.- Returns:
- the created builder.
-
getLevels
- Returns:
- the levels of this Topic Name.
-
filter
- Returns:
- a Topic Filter matching only this Topic Name.
-
extend
@NotNull MqttTopicBuilder.Complete extend()Creates a builder for extending this Topic Name.- Returns:
- the created builder.
-