Enum Class Qos

java.lang.Object
java.lang.Enum<Qos>
org.mqtt4j.hato.Qos
All Implemented Interfaces:
Serializable, Comparable<Qos>, Constable

public enum Qos extends Enum<Qos>
MQTT quality of service levels.
  • Enum Constant Details

    • AT_MOST_ONCE

      public static final Qos AT_MOST_ONCE
      QoS 0: delivered at most once, with no acknowledgement.
    • AT_LEAST_ONCE

      public static final Qos AT_LEAST_ONCE
      QoS 1: delivered at least once, acknowledged with PUBACK.
    • EXACTLY_ONCE

      public static final Qos EXACTLY_ONCE
      QoS 2: delivered exactly once, through the PUBREC, PUBREL, and PUBCOMP handshake.
  • Method Details

    • values

      public static Qos[] 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 Qos 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
    • level

      public int level()
      Returns the numeric level as it appears on the wire.
      Returns:
      the numeric level as it appears on the wire
    • of

      public static Qos of(int level)
      Returns the QoS for a wire-level value.
      Parameters:
      level - the wire-level value
      Returns:
      the QoS for a wire-level value
      Throws:
      IllegalArgumentException -
      if `level` is not 0, 1, or 2