Package com.hivemq.client.mqtt.datatypes
Interface MqttClientIdentifier
- All Superinterfaces:
Comparable<MqttUtf8String>,MqttUtf8String
MQTT Client Identifier according to the MQTT specification.
A Client Identifier has the same requirements as an UTF-8 encoded string.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this Client Identifier must be allowed by every MQTT broker according to the MQTT specification.static @NotNull MqttClientIdentifierValidates and creates a Client Identifier of the given string.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.hivemq.client.mqtt.datatypes.MqttUtf8String
containsShouldNotCharacters, toByteBuffer
-
Method Details
-
of
Validates and creates a Client Identifier of the given string.- Parameters:
string- the string representation of the Client Identifier.- Returns:
- the created Client Identifier.
- Throws:
IllegalArgumentException- if the string is not a valid Client Identifier.
-
mustBeAllowedByServer
boolean mustBeAllowedByServer()Checks whether this Client Identifier must be allowed by every MQTT broker according to the MQTT specification.A Client Identifier must be allowed by every MQTT broker if it is between 1 and 23 characters long and only contains lower or uppercase alphabetical characters or numbers.
- Returns:
- whether this Client Identifier must be allowed by every MQTT broker.
-