Package io.micronaut.mqtt.v5.bind
Class MqttPropertyBinder
java.lang.Object
io.micronaut.mqtt.v5.bind.MqttPropertyBinder
- All Implemented Interfaces:
AnnotatedMqttBinder<MqttV5BindingContext,,MqttProperty> MqttBinder<MqttV5BindingContext,Object>
@Introspected(classes=org.eclipse.paho.mqttv5.common.packet.MqttProperties.class)
@Singleton
public class MqttPropertyBinder
extends Object
implements AnnotatedMqttBinder<MqttV5BindingContext,MqttProperty>
Binds arguments to and from
MqttProperties.
If the name is not one of the supported property names, the name and value will be populated via a UserProperty- Since:
- 1.0.0
- Author:
- James Kleeh
- See Also:
-
for a list of names
-
Constructor Summary
ConstructorsConstructorDescriptionMqttPropertyBinder(io.micronaut.core.convert.ConversionService conversionService) -
Method Summary
Modifier and TypeMethodDescriptionbindFrom(MqttV5BindingContext context, io.micronaut.core.convert.ArgumentConversionContext<Object> conversionContext) Binds the given context and returns an optional value.voidbindTo(MqttV5BindingContext context, Object value, io.micronaut.core.type.Argument<Object> argument) Binds the given value to the given context.
-
Constructor Details
-
MqttPropertyBinder
public MqttPropertyBinder(io.micronaut.core.convert.ConversionService conversionService) - Parameters:
conversionService- The conversion service
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationTypein interfaceAnnotatedMqttBinder<MqttV5BindingContext,MqttProperty> - Returns:
- The annotation type
-
bindTo
public void bindTo(MqttV5BindingContext context, Object value, io.micronaut.core.type.Argument<Object> argument) Description copied from interface:MqttBinderBinds the given value to the given context. Publisher method arguments will be passed to this method.- Specified by:
bindToin interfaceMqttBinder<MqttV5BindingContext,Object> - Parameters:
context- The message contextvalue- The argument valueargument- The publisher argument
-
bindFrom
public Optional<Object> bindFrom(MqttV5BindingContext context, io.micronaut.core.convert.ArgumentConversionContext<Object> conversionContext) Description copied from interface:MqttBinderBinds the given context and returns an optional value. Subscriber method arguments will be passed to this method.- Specified by:
bindFromin interfaceMqttBinder<MqttV5BindingContext,Object> - Parameters:
context- The method contextconversionContext- The argument conversion context- Returns:
- An optional value
-