Class Topic
java.lang.Object
software.amazon.smithy.mqtt.traits.Topic
Represents a parsed MQTT topic.
-
Nested Class Summary
-
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 an MQTT topic and labels.toString()
-
Method Details
-
parse
Parses an MQTT topic and labels.- Parameters:
topic
- Topic to parse.- 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()
-