Make MQTT property value publicly accessible (#10577)
Motivation: There was no way to read MQTT properties outside of `io.netty.handler.codec.mqtt` package Modification: Expose `MqttProperties.MqttProperty` fields `value` and `propertyId` via public methods Result: It's possible to read MQTT properties now
This commit is contained in:
parent
95ce1b95ea
commit
aa85ea9947
@ -109,6 +109,11 @@ public final class MqttProperties {
|
|||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MQTT property base class
|
||||||
|
*
|
||||||
|
* @param <T> property type
|
||||||
|
*/
|
||||||
public abstract static class MqttProperty<T> {
|
public abstract static class MqttProperty<T> {
|
||||||
final T value;
|
final T value;
|
||||||
final int propertyId;
|
final int propertyId;
|
||||||
@ -117,6 +122,23 @@ public final class MqttProperties {
|
|||||||
this.propertyId = propertyId;
|
this.propertyId = propertyId;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get MQTT property value
|
||||||
|
*
|
||||||
|
* @return property value
|
||||||
|
*/
|
||||||
|
public T value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get MQTT property ID
|
||||||
|
* @return property ID
|
||||||
|
*/
|
||||||
|
public int propertyId() {
|
||||||
|
return propertyId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class IntegerProperty extends MqttProperty<Integer> {
|
public static final class IntegerProperty extends MqttProperty<Integer> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user