Enum Qos
- java.lang.Object
-
- java.lang.Enum<Qos>
-
- com.hivemq.extension.sdk.api.packets.general.Qos
-
- All Implemented Interfaces:
Serializable
,Comparable<Qos>
public enum Qos extends Enum<Qos>
The quality of service level (QOS) of a PUBLISH or subscription.- Since:
- 4.0.0, CE 2019.1
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AT_LEAST_ONCE
At least once delivery.AT_MOST_ONCE
At most once delivery.EXACTLY_ONCE
At exactly once delivery.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getQosNumber()
Get the quality service level as integer.static @NotNull Qos
valueOf(int code)
Creates a Qos level enum from an integer.static Qos
valueOf(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 Detail
-
AT_MOST_ONCE
public static final Qos AT_MOST_ONCE
At most once delivery. The message will be delivered once or never (best effort delivery).- Since:
- 4.0.0, CE 2019.1
-
AT_LEAST_ONCE
public static final Qos AT_LEAST_ONCE
At least once delivery. The message will be delivered once or multiple times.- Since:
- 4.0.0, CE 2019.1
-
EXACTLY_ONCE
public static final Qos EXACTLY_ONCE
At exactly once delivery. The message will be delivered once and only once.- Since:
- 4.0.0, CE 2019.1
-
-
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(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getQosNumber
public int getQosNumber()
Get the quality service level as integer.- Returns:
- The quality of service.
- Since:
- 4.0.0, CE 2019.1
-
valueOf
@NotNull public static @NotNull Qos valueOf(int code)
Creates a Qos level enum from an integer.- Parameters:
code
- the Qos level as integer code(0,1,2).- Returns:
- The Qos level.
- Throws:
IllegalArgumentException
- when the parameter is an invalid quality of service level.- Since:
- 4.0.0, CE 2019.1
-
-