Enum Class ModbusRegisterBlockType

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

public enum ModbusRegisterBlockType extends Enum<ModbusRegisterBlockType> implements net.solarnetwork.domain.CodedValue
Modbus register block types.
Since:
4.2
Version:
1.0
Author:
matt
  • Enum Constant Details

  • Method Details

    • values

      public static ModbusRegisterBlockType[] 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 ModbusRegisterBlockType 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
    • getCode

      public int getCode()
      Specified by:
      getCode in interface net.solarnetwork.domain.CodedValue
    • getBitCount

      public int getBitCount()
      Get the number of bits registers of this type use.
      Returns:
      the bit count
    • isReadOnly

      public boolean isReadOnly()
      Get the read-only flag.
      Returns:
      true if registers of this type are read-only
    • isBitType

      public boolean isBitType()
      Get the "bit type-ness" of this register block type.
      Returns:
      true if this is a coil or discrete register block
    • forCode

      public static ModbusRegisterBlockType forCode(int code)
      Get an enumeration instance for a code value.
      Parameters:
      code - the code value to get the enumeration for
      Returns:
      the enumeration
      Throws:
      IllegalArgumentException - if code is not a valid value