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)` Constructor
    `MqttWill(JsonObject json)` Create instance from JSON

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Buffer` | `getWillMessage()`
    `byte[]` | `getWillMessageBytes()`
    `int` | `getWillQos()`
    `String` | `getWillTopic()`
    `boolean` | `isWillFlag()`
    `boolean` | `isWillRetain()`
    `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)

      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

          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

    - #### toJson

          public JsonObject toJson()

      Convert instance in JSON
      Returns:
        JSON representation

Copyright © 2021 Eclipse. All rights reserved.