Class Topic
java.lang.Object
software.amazon.smithy.mqtt.traits.Topic
Represents a parsed MQTT topic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Represents a level in a topic.static enum
Controls the rules for how a value is parsed into a topic. -
Method Summary
Modifier and TypeMethodDescriptionboolean
conflictsWith
(Topic other) Determines if this topic conflicts with another topic.boolean
Gets all of the label levels in the topic.Gets all of the hierarchical levels of the topic.int
hashCode()
boolean
Returns true if the topic contains the given label string.static Topic
Parses a string into an MQTT topic, including substitution labels.static Topic
parse
(Topic.TopicRule rule, String topic) Parses a string into an MQTT topic, including substitution labels.toString()
-
Method Details
-
parse
Parses a string into an MQTT topic, including substitution labels.- Parameters:
topic
- string to parse into a modeled MQTT topic- Returns:
- Returns the parsed topic.
- Throws:
TopicSyntaxException
- if the topic is malformed.
-
parse
Parses a string into an MQTT topic, including substitution labels.- Parameters:
rule
- MQTT-specific rule to apply to the parsingtopic
- string to parse into a modeled MQTT topic- Returns:
- Returns the parsed topic.
- Throws:
TopicSyntaxException
- if the topic is malformed.
-
getLevels
Gets all of the hierarchical levels of the topic.- Returns:
- Returns the topic levels.
-
getLabels
Gets all of the label levels in the topic.- Returns:
- Returns the label levels.
-
hasLabel
Returns true if the topic contains the given label string.- Parameters:
label
- Label to check for.- Returns:
- Returns true if the label exists in the topic.
-
conflictsWith
Determines if this topic conflicts with another topic.- Parameters:
other
- Topic to check against.- Returns:
- Returns true if there is a conflict.
-
toString
-
equals
-
hashCode
public int hashCode()
-