io.vertx.mqtt

## Class MqttWill

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

-     public class MqttWill
      extends Object

  Will information from the remote MQTT client

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MqttWill(boolean isWillFlag, String willTopic, Buffer willMessage, int willQos, boolean isWillRetain, io.netty.handler.codec.mqtt.MqttProperties willProperties)` Constructor
    `MqttWill(JsonObject json)` Create instance from JSON

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Buffer` | `getWillMessage()`
    `byte[]` | `getWillMessageBytes()`
    `io.netty.handler.codec.mqtt.MqttProperties` | `getWillProperties()`
    `int` | `getWillQos()`
    `String` | `getWillTopic()`
    `boolean` | `isWillFlag()`
    `boolean` | `isWillRetain()`
    `static io.netty.handler.codec.mqtt.MqttProperties` | `propertiesFromJson(JsonArray array)`
    `static JsonArray` | `propertiesToJson(io.netty.handler.codec.mqtt.MqttProperties properties)`
    `static io.netty.handler.codec.mqtt.MqttProperties.MqttProperty<?>` | `propertyFromJson(JsonObject obj)`
    `static JsonObject` | `propertyToJson(io.netty.handler.codec.mqtt.MqttProperties.MqttProperty<?> prop)`
    `JsonObject` | `toJson()` Convert instance in JSON

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MqttWill

          public MqttWill(boolean isWillFlag,
                          String willTopic,
                          Buffer willMessage,
                          int willQos,
                          boolean isWillRetain,
                          io.netty.handler.codec.mqtt.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 Detail

    - #### 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 io.netty.handler.codec.mqtt.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(io.netty.handler.codec.mqtt.MqttProperties properties)

    - #### propertyToJson

          public static JsonObject propertyToJson(io.netty.handler.codec.mqtt.MqttProperties.MqttProperty<?> prop)

    - #### propertiesFromJson

          public static io.netty.handler.codec.mqtt.MqttProperties propertiesFromJson(JsonArray array)

    - #### propertyFromJson

          public static io.netty.handler.codec.mqtt.MqttProperties.MqttProperty<?> propertyFromJson(JsonObject obj)

Copyright © 2022 Eclipse. All rights reserved.