Package 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 | Description
    --- | ---
    `MqttWill​(boolean isWillFlag, String willTopic, Buffer willMessage, int willQos, boolean isWillRetain, MqttProperties willProperties)` | Constructor
    `MqttWill​(JsonObject json)` | Create instance from JSON

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Buffer` | `getWillMessage()` |
    `byte[]` | `getWillMessageBytes()` |
    `MqttProperties` | `getWillProperties()` |
    `int` | `getWillQos()` |
    `String` | `getWillTopic()` |
    `boolean` | `isWillFlag()` |
    `boolean` | `isWillRetain()` |
    `static MqttProperties` | `propertiesFromJson​(JsonArray array)` |
    `static JsonArray` | `propertiesToJson​(MqttProperties properties)` |
    `static MqttProperties.MqttProperty<?>` | `propertyFromJson​(JsonObject obj)` |
    `static JsonObject` | `propertyToJson​(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,
                          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 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)