@Singleton public class DefaultMqttBinder extends java.lang.Object implements FallbackMqttBinder<MqttBindingContext<?>>
FallbackMqttBinder
to bind arguments that don't match any
annotated or typed based binder. Matches arguments to properties in the message
based on the argument name. If the name is not recognized, the argument is bound
with the payload of the message.Constructor and Description |
---|
DefaultMqttBinder(PayloadMqttBinder payloadMqttBinder) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.Object> |
bindFrom(MqttBindingContext<?> context,
io.micronaut.core.convert.ArgumentConversionContext<java.lang.Object> conversionContext)
Binds the given context and returns an optional value.
|
void |
bindTo(MqttBindingContext<?> context,
java.lang.Object value,
io.micronaut.core.type.Argument<java.lang.Object> argument)
Binds the given value to the given context.
|
public DefaultMqttBinder(PayloadMqttBinder payloadMqttBinder)
public void bindTo(MqttBindingContext<?> context, java.lang.Object value, io.micronaut.core.type.Argument<java.lang.Object> argument)
MqttBinder
bindTo
in interface MqttBinder<MqttBindingContext<?>,java.lang.Object>
context
- The message contextvalue
- The argument valueargument
- The publisher argumentpublic java.util.Optional<java.lang.Object> bindFrom(MqttBindingContext<?> context, io.micronaut.core.convert.ArgumentConversionContext<java.lang.Object> conversionContext)
MqttBinder
bindFrom
in interface MqttBinder<MqttBindingContext<?>,java.lang.Object>
context
- The method contextconversionContext
- The argument conversion context