Enum Class Qos
- All Implemented Interfaces:
Serializable, Comparable<Qos>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionQoS 1: delivered at least once, acknowledged with PUBACK.QoS 0: delivered at most once, with no acknowledgement.QoS 2: delivered exactly once, through the PUBREC, PUBREL, and PUBCOMP handshake. -
Method Summary
Modifier and TypeMethodDescriptionintlevel()Returns the numeric level as it appears on the wire.static Qosof(int level) Returns the QoS for a wire-level value.static QosReturns the enum constant of this class with the specified name.static Qos[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AT_MOST_ONCE
QoS 0: delivered at most once, with no acknowledgement. -
AT_LEAST_ONCE
QoS 1: delivered at least once, acknowledged with PUBACK. -
EXACTLY_ONCE
QoS 2: delivered exactly once, through the PUBREC, PUBREL, and PUBCOMP handshake.
-
-
Method Details
-
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
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 nameNullPointerException- 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
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
-