Enum Class MqttQos

java.lang.Object
java.lang.Enum<MqttQos>
com.hivemq.client.mqtt.datatypes.MqttQos
All Implemented Interfaces:
Serializable, Comparable<MqttQos>, Constable

public enum MqttQos extends Enum<MqttQos>
MQTT Quality of Service (QoS) according to the MQTT specification.
Since:
1.0
  • Enum Constant Details

    • AT_MOST_ONCE

      public static final MqttQos AT_MOST_ONCE
      QoS for at most once delivery according to the capabilities of the underlying network.
    • AT_LEAST_ONCE

      public static final MqttQos AT_LEAST_ONCE
      QoS for ensuring at least once delivery.
    • EXACTLY_ONCE

      public static final MqttQos EXACTLY_ONCE
      QoS for ensuring exactly once delivery.
  • Method Details

    • values

      public static MqttQos[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MqttQos valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Returns:
      the byte code of this QoS.
    • fromCode

      @Nullable public static @Nullable MqttQos fromCode(int code)
      Returns the QoS belonging to the given byte code.
      Parameters:
      code - the byte code.
      Returns:
      the QoS belonging to the given byte code or null if the byte code is not a valid QoS code.