Package cool.mqtt.hooks
Enum QoS
java.lang.Object
java.lang.Enum<QoS>
cool.mqtt.hooks.QoS
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<QoS>
,java.lang.constant.Constable
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.
-
Nested Class Summary
-
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
Modifier and Type Method Description int
getValue()
Gets the Quality of Service levelint
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.
-
Enum Constant Details
-
AT_MOST_ONCE
The singleton instance for At most once level. This has the numeric value of0
. -
AT_LEAST_ONCE
The singleton instance for At least once level. This has the numeric value of1
. -
EXACTLY_ONCE
The singleton instance for Exactly once level. This has the numeric value of2
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 namejava.lang.NullPointerException
- if the argument is null
-
getValue
public int getValue()Gets the Quality of Service levelint
value.- Returns:
- the Quality of Service level, from 0 (
AT_MOST_ONCE
) to 2 (EXACTLY_ONCE
once)
-