hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
860 stars 159 forks source link

Document `MqttUtf8String.toString()` behavior #523

Open Marcono1234 opened 2 years ago

Marcono1234 commented 2 years ago

Problem or use case

It appears the intention of MqttUtf8String.toString() is to return the decoded String (see also implementation). However, this is currently not documented; toString() is not overridden and its documentation is not adjusted. It is therefore not obvious how a user can easily get a String from a MqttUtf8String.

Preferred solution or suggestions

If MqttUtf8String.toString() is guaranteed to return the decoded String, then MqttUtf8String should override toString() and add a Javadoc comment to it describing its behavior.