Enum Class ModbusDataType

java.lang.Object
java.lang.Enum<ModbusDataType>
net.solarnetwork.node.io.modbus.ModbusDataType
All Implemented Interfaces:
Serializable, Comparable<ModbusDataType>, Constable

public enum ModbusDataType extends Enum<ModbusDataType>
An enumeration of common Modbus data types.
Since:
2.5
Version:
1.1
Author:
matt
  • Enum Constant Details

    • Boolean

      public static final ModbusDataType Boolean
      Boolean bit.
    • Float16

      public static final ModbusDataType Float16
      16-bit floating point.
      Since:
      1.1
    • Float32

      public static final ModbusDataType Float32
      32-bit floating point.
    • Float64

      public static final ModbusDataType Float64
      64-bit floating point.
    • Int16

      public static final ModbusDataType Int16
      Signed 16-bit integer.
    • UInt16

      public static final ModbusDataType UInt16
      Unsigned 16-bit integer.
    • Int32

      public static final ModbusDataType Int32
      Signed 32-bit integer.
    • UInt32

      public static final ModbusDataType UInt32
      Unsigned 32-bit integer.
    • Int64

      public static final ModbusDataType Int64
      Signed 64-bit integer.
    • UInt64

      public static final ModbusDataType UInt64
      Unsigned 64-bit integer.
    • Bytes

      public static final ModbusDataType Bytes
      Raw bytes.
    • StringUtf8

      public static final ModbusDataType StringUtf8
      Bytes interpreted as a UTF-8 encoded string.
    • StringAscii

      public static final ModbusDataType StringAscii
      Bytes interpreted as an ASCII encoded string.
  • Method Details

    • values

      public static ModbusDataType[] 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

      public static ModbusDataType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getKey

      public String 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

      public static ModbusDataType forKey(String key)
      Get an enum instance for a key value.
      Parameters:
      key - the key
      Returns:
      the enum
      Throws:
      IllegalArgumentException - if key is not a valid value
    • toDisplayString

      public String toDisplayString()
      Get a friendly display string for this data type.
      Returns:
      the display string