Package io.micronaut.mqtt.bind.impl
Class IdMqttBinder
java.lang.Object
io.micronaut.mqtt.bind.impl.IdMqttBinder
- All Implemented Interfaces:
AnnotatedMqttBinder<MqttBindingContext<?>,
,Id> MqttBinder<MqttBindingContext<?>,
Object>
@Singleton
public class IdMqttBinder
extends Object
implements AnnotatedMqttBinder<MqttBindingContext<?>,Id>
An annotated argument binder for
Id
.- Since:
- 1.0.0
- Author:
- James Kleeh
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbindFrom
(MqttBindingContext<?> context, io.micronaut.core.convert.ArgumentConversionContext<Object> conversionContext) Binds the given context and returns an optional value.void
bindTo
(MqttBindingContext<?> context, Object value, io.micronaut.core.type.Argument<Object> argument) Binds the given value to the given context.
-
Constructor Details
-
IdMqttBinder
public IdMqttBinder(io.micronaut.core.convert.ConversionService conversionService)
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationType
in interfaceAnnotatedMqttBinder<MqttBindingContext<?>,
Id> - Returns:
- The annotation type
-
bindTo
public void bindTo(MqttBindingContext<?> context, Object value, io.micronaut.core.type.Argument<Object> argument) Description copied from interface:MqttBinder
Binds the given value to the given context. Publisher method arguments will be passed to this method.- Specified by:
bindTo
in interfaceMqttBinder<MqttBindingContext<?>,
Object> - Parameters:
context
- The message contextvalue
- The argument valueargument
- The publisher argument
-
bindFrom
public Optional<Object> bindFrom(MqttBindingContext<?> context, io.micronaut.core.convert.ArgumentConversionContext<Object> conversionContext) Description copied from interface:MqttBinder
Binds the given context and returns an optional value. Subscriber method arguments will be passed to this method.- Specified by:
bindFrom
in interfaceMqttBinder<MqttBindingContext<?>,
Object> - Parameters:
context
- The method contextconversionContext
- The argument conversion context- Returns:
- An optional value
-