Package io.openems.edge.common.channel
Interface Doc
- All Known Implementing Classes:
AbstractDoc
,BooleanDoc
,DoubleDoc
,EnumDoc
,ErrorDoc
,FloatDoc
,IntegerDoc
,LongDoc
,OpenemsTypeDoc
,ShortDoc
,StateChannelDoc
,StateCollectorChannelDoc
,StringDoc
public interface Doc
Provides static meta information for a
Channel
.
Possible meta information include:
- access-mode (read-only/read-write/write-only) flag
invalid reference
Doc#accessMode(AccessMode)
- expected OpenemsType via
getType()
- descriptive text via
getText()
- is debug mode activated via
isDebug()
- callback on initialization of a Channel via
invalid reference
Doc#getOnInitCallback()
-
Method Summary
Modifier and TypeMethodDescription<C extends Channel<?>>
CcreateChannelInstance
(OpenemsComponent component, ChannelId channelId) Creates an instance ofChannel
for the given Channel-ID using its Channel-AbstractDoc
.Gets the 'Access-Mode' information.Gets theChannelCategory
of the Channel of this Doc.Gets the Persistence Priority.getText()
Gets the descriptive text.getType()
Gets the OpenemsType.getUnit()
Gets the Unit.boolean
isDebug()
Is the more verbose debug mode activated?.static StateChannelDoc
Create a Channel-Doc for aStateChannel
with a givenLevel
.static OpenemsTypeDoc
<?> of
(OpenemsType type) Create a Channel-Doc with a specific OpenemsType.static EnumDoc
of
(OptionsEnum[] options) Create a Channel-Doc with specific options defined by anOptionsEnum
.Sets the descriptive text.
-
Method Details
-
of
Create a Channel-Doc with a specific OpenemsType.use like this:
Doc.of(OpenemsType.INTEGER)
- Parameters:
type
- the OpenemsType- Returns:
- an instance of
OpenemsTypeDoc
-
of
Create a Channel-Doc with specific options defined by anOptionsEnum
.use like this:
Doc.of([YourOptionsEnum].values())
- Parameters:
options
- the possible options as an OptionsEnum- Returns:
- an instance of
EnumDoc
-
of
- Parameters:
level
- the Level- Returns:
- an instance of
StateChannelDoc
-
getChannelCategory
ChannelCategory getChannelCategory()Gets theChannelCategory
of the Channel of this Doc.- Returns:
- the ChannelCategory
-
getType
OpenemsType getType()Gets the OpenemsType.- Returns:
- the OpenemsType
-
getAccessMode
AccessMode getAccessMode()Gets the 'Access-Mode' information.- Returns:
- the
AccessMode
-
getUnit
Unit getUnit()Gets the Unit. Defaults to NONE.- Returns:
- the unit
-
getPersistencePriority
PersistencePriority getPersistencePriority()Gets the Persistence Priority. Defaults to VERY_LOW.This parameter may be used by persistence services to decide, if the Channel should be persisted to the hard disk.
- Returns:
- the
PersistencePriority
-
text
Sets the descriptive text. Defaults to an empty string.- Parameters:
text
- the text- Returns:
- myself
-
getText
String getText()Gets the descriptive text. Defaults to empty String.- Returns:
- the text
-
isDebug
boolean isDebug()Is the more verbose debug mode activated?.- Returns:
- true for debug mode
-
createChannelInstance
Creates an instance ofChannel
for the given Channel-ID using its Channel-AbstractDoc
.- Type Parameters:
C
- the type of the Channel- Parameters:
component
- theOpenemsComponent
channelId
- the Channel-ID- Returns:
- the Channel
-