Enum QoS

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<QoS>

    public enum QoS
    extends java.lang.Enum<QoS>
    The Quality of Service.

    QoS is an enum representing the 3 Quality of Service levels according to which the MQTT broker delivers Application Messages.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AT_LEAST_ONCE
      The singleton instance for At least once level.
      AT_MOST_ONCE
      The singleton instance for At most once level.
      EXACTLY_ONCE
      The singleton instance for Exactly once level.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getValue()
      Gets the Quality of Service level int value.
      static QoS valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static QoS[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • AT_MOST_ONCE

        public static final QoS AT_MOST_ONCE
        The singleton instance for At most once level. This has the numeric value of 0.
      • AT_LEAST_ONCE

        public static final QoS AT_LEAST_ONCE
        The singleton instance for At least once level. This has the numeric value of 1.
      • EXACTLY_ONCE

        public static final QoS EXACTLY_ONCE
        The singleton instance for Exactly once level. This has the numeric value of 2.
    • Method Detail

      • values

        public static QoS[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (QoS c : QoS.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static QoS valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public int getValue()
        Gets the Quality of Service level int value.
        Returns:
        the Quality of Service level, from 0 (AT_MOST_ONCE) to 2 (EXACTLY_ONCE once)