Class PayloadMqttBinder

java.lang.Object
io.micronaut.mqtt.bind.impl.PayloadMqttBinder
All Implemented Interfaces:
AnnotatedMqttBinder<MqttBindingContext<?>,io.micronaut.messaging.annotation.MessageBody>, MqttBinder<MqttBindingContext<?>,Object>

@Singleton public class PayloadMqttBinder extends Object implements AnnotatedMqttBinder<MqttBindingContext<?>,io.micronaut.messaging.annotation.MessageBody>
A binder responsible for binding to the payload of the message.
Since:
1.0.0
Author:
James Kleeh
  • Constructor Details

  • Method Details

    • getAnnotationType

      public Class<io.micronaut.messaging.annotation.MessageBody> getAnnotationType()
      Specified by:
      getAnnotationType in interface AnnotatedMqttBinder<MqttBindingContext<?>,io.micronaut.messaging.annotation.MessageBody>
      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 interface MqttBinder<MqttBindingContext<?>,Object>
      Parameters:
      context - The message context
      value - The argument value
      argument - 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 interface MqttBinder<MqttBindingContext<?>,Object>
      Parameters:
      context - The method context
      conversionContext - The argument conversion context
      Returns:
      An optional value