Package com.plccom.mqtt.client
Enum PlccomMqttProtocolVersion
- java.lang.Object
-
- java.lang.Enum<PlccomMqttProtocolVersion>
-
- com.plccom.mqtt.client.PlccomMqttProtocolVersion
-
- All Implemented Interfaces:
Serializable,Comparable<PlccomMqttProtocolVersion>
public enum PlccomMqttProtocolVersion extends Enum<PlccomMqttProtocolVersion>
MQTT protocol version requested by a PLCcom MQTT client connection.AUTOlets the client select the broadest compatible protocol: it first tries MQTT 5.0 and falls back to MQTT 3.1.1 only when the broker clearly rejects the protocol version during connection negotiation.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTOLet the client choose the best supported protocol version.MQTT_3_1_1Force MQTT 3.1.1.MQTT_5_0Force MQTT 5.0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDisplayName()Returns a human-readable version label.booleanisConcreteVersion()Returns whether this value names a concrete wire protocol version.static PlccomMqttProtocolVersionvalueOf(String name)Returns the enum constant of this type with the specified name.static PlccomMqttProtocolVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AUTO
public static final PlccomMqttProtocolVersion AUTO
Let the client choose the best supported protocol version.
-
MQTT_3_1_1
public static final PlccomMqttProtocolVersion MQTT_3_1_1
Force MQTT 3.1.1.
-
MQTT_5_0
public static final PlccomMqttProtocolVersion MQTT_5_0
Force MQTT 5.0.
-
-
Method Detail
-
values
public static PlccomMqttProtocolVersion[] 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 (PlccomMqttProtocolVersion c : PlccomMqttProtocolVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PlccomMqttProtocolVersion 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
-
isConcreteVersion
public boolean isConcreteVersion()
Returns whether this value names a concrete wire protocol version.- Returns:
truefor MQTT 3.1.1 and MQTT 5.0,falseforAUTO
-
getDisplayName
public String getDisplayName()
Returns a human-readable version label.- Returns:
- display label suitable for diagnostics and simple UI choices
-
-