Class ModbusSlaveNatureTable
- java.lang.Object
-
- io.openems.edge.common.modbusslave.ModbusSlaveNatureTable
-
public final class ModbusSlaveNatureTable extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModbusSlaveNatureTable.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static short
generateHash(java.lang.String text)
Generates a hash code from a string text.int
getLength()
ModbusRecord[]
getModbusRecords()
java.lang.Class<?>
getNatureClass()
Gets the Nature class.short
getNatureHash()
Gets the Hash code for this Nature, built from the Nature-Name viagetNatureName()
.java.lang.String
getNatureName()
Gets the Nature name, i.e.static ModbusSlaveNatureTable.Builder
of(java.lang.Class<?> nature, AccessMode accessMode, int length)
-
-
-
Method Detail
-
generateHash
public static short generateHash(java.lang.String text)
Generates a hash code from a string text.- Parameters:
text
- the text (e.g. "OpenemsComponent")- Returns:
- the short hash value (e.g. "0xb3dc")
-
of
public static ModbusSlaveNatureTable.Builder of(java.lang.Class<?> nature, AccessMode accessMode, int length)
- Parameters:
nature
- the OpenEMS NatureClass
accessMode
- theAccessMode
length
- the reserved total length- Returns:
- the
ModbusSlaveNatureTable.Builder
-
getNatureClass
public java.lang.Class<?> getNatureClass()
Gets the Nature class.- Returns:
- the nature class, e.g.
OpenemsComponent
-
getNatureName
public java.lang.String getNatureName()
Gets the Nature name, i.e. the SimpleName of the Nature Class.- Returns:
- the nature name, e.g. "OpenemsComponent" for
OpenemsComponent
-
getNatureHash
public short getNatureHash()
Gets the Hash code for this Nature, built from the Nature-Name viagetNatureName()
.- Returns:
- the Hash code, e.g. "0xb3dc" for "OpenemsComponent"
-
getLength
public int getLength()
-
getModbusRecords
public ModbusRecord[] getModbusRecords()
-
-