Package net.solarnetwork.node.io.modbus
Enum Class 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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ModbusRegisterBlockTypeforCode(int code) Get an enumeration instance for a code value.intGet the number of bits registers of this type use.intgetCode()booleanGet the "bit type-ness" of this register block type.booleanGet the read-only flag.static ModbusRegisterBlockTypeReturns the enum constant of this class with the specified name.static ModbusRegisterBlockType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Coil
Coil (toggle) type. -
Discrete
Discrete (input) type. -
Holding
Holding (output) type. -
Input
Input type.
-
-
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
-
getCode
public int getCode()- Specified by:
getCodein interfacenet.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
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
-