Enum Class ModbusConstants.ValueType
java.lang.Object
java.lang.Enum<ModbusConstants.ValueType>
org.openhab.core.io.transport.modbus.ModbusConstants.ValueType
- All Implemented Interfaces:
Serializable
,Comparable<ModbusConstants.ValueType>
,Constable
- Enclosing class:
- ModbusConstants
Value types for different number types.
- Author:
- Sami Salonen - Initial contribution
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic ModbusConstants.ValueType
fromConfigValue
(@Nullable String configValueType) Constructs ValueType given the config value string.int
getBits()
Returns number of bits represented by this ValueTypeReturns config value to refer to this value typetoString()
Returns config valuestatic ModbusConstants.ValueType
Returns the enum constant of this class with the specified name.static ModbusConstants.ValueType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BIT
-
INT8
-
UINT8
-
INT16
-
UINT16
-
INT32
-
UINT32
-
FLOAT32
-
INT64
-
UINT64
-
INT32_SWAP
-
UINT32_SWAP
-
FLOAT32_SWAP
-
INT64_SWAP
-
UINT64_SWAP
-
-
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
-
getBits
public int getBits()Returns number of bits represented by this ValueType- Returns:
- number of bits
-
getConfigValue
Returns config value to refer to this value type- Returns:
- config value as string
-
toString
Returns config value- Overrides:
toString
in classEnum<ModbusConstants.ValueType>
-
fromConfigValue
public static ModbusConstants.ValueType fromConfigValue(@Nullable String configValueType) throws IllegalArgumentException Constructs ValueType given the config value string.- Parameters:
configValueType
- config value that will be parsed to ValueType- Returns:
- ValueType matching the config value
- Throws:
IllegalArgumentException
- with unknown value types
-