Package com.hivemq.client.mqtt.datatypes
Interface MqttSharedTopicFilter
- All Superinterfaces:
Comparable<MqttUtf8String>,MqttTopicFilter,MqttUtf8String
MQTT Shared Topic Filter according to the MQTT specification.
A Shared Topic Filter consists of the share prefix ("$share/"), a Share Name and a Topic Filter.
The Share Name has the same requirements as an UTF-8 encoded string. Additionally it
- must be at least 1 character long,
- must not contain wildcard characters ('#', '+') and
- must not contain a topic level separator ('/')
The Topic Filter has the same restrictions as a Topic Filter.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe prefix of a Shared Topic Filter.Fields inherited from interface com.hivemq.client.mqtt.datatypes.MqttTopicFilter
MULTI_LEVEL_WILDCARD, SINGLE_LEVEL_WILDCARD -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder for a Shared Topic Filter.Creates a builder for extending this Shared Topic Filter.static @NotNull MqttSharedTopicFilterValidates and creates a Shared Topic Filter of the given Share Name and Topic Filter.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.hivemq.client.mqtt.datatypes.MqttTopicFilter
containsMultiLevelWildcard, containsSingleLevelWildcard, containsWildcards, extend, getLevels, isShared, matches, matches, shareMethods inherited from interface com.hivemq.client.mqtt.datatypes.MqttUtf8String
containsShouldNotCharacters, toByteBuffer
-
Field Details
-
SHARE_PREFIX
The prefix of a Shared Topic Filter.- See Also:
-
-
Method Details
-
of
@NotNull static @NotNull MqttSharedTopicFilter of(@NotNull @NotNull String shareName, @NotNull @NotNull String topicFilter) Validates and creates a Shared Topic Filter of the given Share Name and Topic Filter.- Parameters:
shareName- the string representation of the Share Name.topicFilter- the string representation of the Topic Filter.- Returns:
- the created Shared Topic Filter.
- Throws:
IllegalArgumentException- if the Share Name string is not a valid Share Name or the Topic Filter string is not a valid Topic Filter.
-
builder
Creates a builder for a Shared Topic Filter.- Parameters:
shareName- the string representation of the Share Name.- Returns:
- the created builder.
-
getTopicFilter
- Returns:
- the Topic Filter of this Shared Topic Filter.
-