Class RegisterValue
-
- All Implemented Interfaces:
-
kotlin.Comparable
public final class RegisterValue implements Comparable<RegisterValue>
Holds the single value of a single modbus register
-
-
Constructor Summary
Constructors Constructor Description RegisterValue(Address address)
-
Method Summary
Modifier and Type Method Description final StringgetFetchGroup()An identifier to that can be used to ensure some registers are retrieved together. final UnitsetFetchGroup(String fetchGroup)An identifier to that can be used to ensure some registers are retrieved together. final BooleangetImmutable()Some registers will NEVER change and thus do not need to be retrieved a second time final UnitsetImmutable(Boolean immutable)Some registers will NEVER change and thus do not need to be retrieved a second time final ShortgetValue()final StringgetComment()If a register has a comment this can be used when converting it to a String (in yaml for example) final UnitsetComment(String comment)If a register has a comment this can be used when converting it to a String (in yaml for example) final LonggetFetchTimestamp()final UnitsetFetchTimestamp(Long fetchTimestamp)final LonggetTimestamp()final BooleangetHardReadError()final UnitsetHardReadError(Boolean hardReadError)final StringgetHexValue()final AddressgetAddress()The modbus register address. final RegisterValueclone()final RegisterValuesetValue(Short value)final RegisterValuesetValue(RegisterValue registerValue)final RegisterValuesetValue(Short value, Long timestamp)final BooleanhasValue()final UnitsetSoftReadError()final UnitsetHardReadError()final BooleanisReadError()final UnitclearSoftReadError()final BooleanneedsToBeUpdated(Long now, Long maxAge)final Unitclear()StringtoString()IntegercompareTo(RegisterValue other)Booleanequals(Object other)IntegerhashCode()-
-
Constructor Detail
-
RegisterValue
RegisterValue(Address address)
-
-
Method Detail
-
getFetchGroup
final String getFetchGroup()
An identifier to that can be used to ensure some registers are retrieved together. By default, filled with a random unique value because we assume they are all independent.
-
setFetchGroup
final Unit setFetchGroup(String fetchGroup)
An identifier to that can be used to ensure some registers are retrieved together. By default, filled with a random unique value because we assume they are all independent.
-
getImmutable
final Boolean getImmutable()
Some registers will NEVER change and thus do not need to be retrieved a second time
-
setImmutable
final Unit setImmutable(Boolean immutable)
Some registers will NEVER change and thus do not need to be retrieved a second time
-
getComment
final String getComment()
If a register has a comment this can be used when converting it to a String (in yaml for example)
-
setComment
final Unit setComment(String comment)
If a register has a comment this can be used when converting it to a String (in yaml for example)
-
getFetchTimestamp
final Long getFetchTimestamp()
-
setFetchTimestamp
final Unit setFetchTimestamp(Long fetchTimestamp)
-
getTimestamp
final Long getTimestamp()
-
getHardReadError
final Boolean getHardReadError()
-
setHardReadError
final Unit setHardReadError(Boolean hardReadError)
-
getHexValue
final String getHexValue()
-
getAddress
final Address getAddress()
The modbus register address.
-
clone
final RegisterValue clone()
-
setValue
final RegisterValue setValue(Short value)
-
setValue
final RegisterValue setValue(RegisterValue registerValue)
-
setValue
final RegisterValue setValue(Short value, Long timestamp)
-
setSoftReadError
final Unit setSoftReadError()
-
setHardReadError
final Unit setHardReadError()
-
isReadError
final Boolean isReadError()
-
clearSoftReadError
final Unit clearSoftReadError()
-
needsToBeUpdated
final Boolean needsToBeUpdated(Long now, Long maxAge)
-
compareTo
Integer compareTo(RegisterValue other)
-
-
-
-