Class MqttWill

java.lang.Object
io.vertx.mqtt.MqttWill

public class MqttWill extends Object
Will information from the remote MQTT client
  • Constructor Details

    • MqttWill

      public MqttWill(boolean isWillFlag, String willTopic, Buffer willMessage, int willQos, boolean isWillRetain, MqttProperties willProperties)
      Constructor
      Parameters:
      isWillFlag - indicates will message presence
      willTopic - topic to publish the will
      willMessage - payload of the will
      willQos - qos level for the will
      isWillRetain - if the will message must be retained
      willProperties - MQTT properties of the last will message
    • MqttWill

      public MqttWill(JsonObject json)
      Create instance from JSON
      Parameters:
      json - the JSON
  • Method Details

    • isWillFlag

      public boolean isWillFlag()
      Returns:
      the will flag for indicating the will message presence
    • getWillTopic

      public String getWillTopic()
      Returns:
      the topic for the will as provided by the remote MQTT client
    • getWillMessage

      public Buffer getWillMessage()
      Returns:
      the payload for the will as provided by the remote MQTT client
    • getWillMessageBytes

      public byte[] getWillMessageBytes()
      Returns:
      the payload for the will as provided by the remote MQTT client
    • getWillQos

      public int getWillQos()
      Returns:
      the QoS level for the will as provided by the remote MQTT client
    • isWillRetain

      public boolean isWillRetain()
      Returns:
      true if the will must be retained as provided by the remote MQTT client
    • getWillProperties

      public MqttProperties getWillProperties()
      Returns:
      MQTT properties of the last will message
    • toJson

      public JsonObject toJson()
      Convert instance in JSON
      Returns:
      JSON representation
    • propertiesToJson

      public static JsonArray propertiesToJson(MqttProperties properties)
    • propertyToJson

      public static JsonObject propertyToJson(MqttProperties.MqttProperty<?> prop)
    • propertiesFromJson

      public static MqttProperties propertiesFromJson(JsonArray array)
    • propertyFromJson

      public static MqttProperties.MqttProperty<?> propertyFromJson(JsonObject obj)