Package net.solarnetwork.node.io.modbus
Enum Class ModbusDataType
- All Implemented Interfaces:
Serializable,Comparable<ModbusDataType>,Constable
An enumeration of common Modbus data types.
- Since:
- 2.5
- Version:
- 1.1
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBoolean bit.Raw bytes.16-bit floating point.32-bit floating point.64-bit floating point.Signed 16-bit integer.Signed 32-bit integer.Signed 64-bit integer.Bytes interpreted as an ASCII encoded string.Bytes interpreted as a UTF-8 encoded string.Unsigned 16-bit integer.Unsigned 32-bit integer.Unsigned 64-bit integer. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModbusDataTypeGet an enum instance for a key value.getKey()Get the key value for this enum.intGet the number of Modbus words (16-bit register values) this data type requires.Get a friendly display string for this data type.static ModbusDataTypeReturns the enum constant of this class with the specified name.static ModbusDataType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Boolean
Boolean bit. -
Float16
16-bit floating point.- Since:
- 1.1
-
Float32
32-bit floating point. -
Float64
64-bit floating point. -
Int16
Signed 16-bit integer. -
UInt16
Unsigned 16-bit integer. -
Int32
Signed 32-bit integer. -
UInt32
Unsigned 32-bit integer. -
Int64
Signed 64-bit integer. -
UInt64
Unsigned 64-bit integer. -
Bytes
Raw bytes. -
StringUtf8
Bytes interpreted as a UTF-8 encoded string. -
StringAscii
Bytes interpreted as an ASCII encoded string.
-
-
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
-
getKey
Get the key value for this enum.- Returns:
- the key
-
getWordLength
public int getWordLength()Get the number of Modbus words (16-bit register values) this data type requires.- Returns:
- the number of words, or -1 for an unknown length (for example for strings)
-
forKey
Get an enum instance for a key value.- Parameters:
key- the key- Returns:
- the enum
- Throws:
IllegalArgumentException- ifkeyis not a valid value
-
toDisplayString
Get a friendly display string for this data type.- Returns:
- the display string
-