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, byte[] willMessage, int willQos, boolean isWillRetain)` Constructor
    `MqttWill(JsonObject json)` Create instance from JSON

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getWillMessage()` Deprecated. use `getWillMessageBytes()` instead
    `byte[]` | `getWillMessageBytes()`
    `int` | `getWillQos()`
    `String` | `getWillTopic()`
    `boolean` | `isWillFlag()`
    `boolean` | `isWillRetain()`
    `JsonObject` | `toJson()` Convert instance in JSON
    `String` | `willMessage()` Deprecated. use `getWillMessageBytes()` instead
    `int` | `willQos()` Deprecated. use `willQos()` instead
    `String` | `willTopic()` Deprecated. use `getWillTopic()` instead

    - ### 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,
                          byte[] willMessage,
                          int willQos,
                          boolean isWillRetain)

      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

    - #### 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

          @Deprecated
          public String getWillMessage()

      Deprecated. use `getWillMessageBytes()` instead
      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

    - #### willTopic

          @Deprecated
          public String willTopic()

      Deprecated. use `getWillTopic()` instead
      Returns:
        the topic for the will as provided by the remote MQTT client

    - #### willMessage

          @Deprecated
          public String willMessage()

      Deprecated. use `getWillMessageBytes()` instead
      Returns:
        the payload for the will as provided by the remote MQTT client

    - #### willQos

          @Deprecated
          public int willQos()

      Deprecated. use `willQos()` instead
      Returns:
        the QoS level for the will as provided by the remote MQTT client

    - #### toJson

          public JsonObject toJson()

      Convert instance in JSON
      Returns:
        JSON representation

Copyright © 2019 Eclipse. All rights reserved.