Class ModbusSlaveNatureTable

java.lang.Object
io.openems.edge.common.modbusslave.ModbusSlaveNatureTable

public final class ModbusSlaveNatureTable extends Object
  • Method Details

    • generateHash

      public static short generateHash(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(Class<?> nature, AccessMode accessMode, int length)
      Parameters:
      nature - the OpenEMS Nature Class
      accessMode - the AccessMode
      length - the reserved total length
      Returns:
      the ModbusSlaveNatureTable.Builder
    • getNatureClass

      public Class<?> getNatureClass()
      Gets the Nature class.
      Returns:
      the nature class, e.g. OpenemsComponent
    • getNatureName

      public 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 via getNatureName().
      Returns:
      the Hash code, e.g. "0xb3dc" for "OpenemsComponent"
    • getLength

      public int getLength()
    • getModbusRecords

      public ModbusRecord[] getModbusRecords()