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)
    . Defaults to Read-Only.
  • 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 Details

    • of

      static OpenemsTypeDoc<?> of(OpenemsType type)
      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

      static EnumDoc of(OptionsEnum[] options)
      Create a Channel-Doc with specific options defined by an OptionsEnum.

      use like this:

       Doc.of([YourOptionsEnum].values())
       
      Parameters:
      options - the possible options as an OptionsEnum
      Returns:
      an instance of EnumDoc
    • of

      static StateChannelDoc of(Level level)
      Create a Channel-Doc for a StateChannel with a given Level.

      use like this:

       Doc.of(Level.FAULT)
       
      Parameters:
      level - the Level
      Returns:
      an instance of StateChannelDoc
    • getChannelCategory

      ChannelCategory getChannelCategory()
      Gets the ChannelCategory 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

      Doc text(String 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

      <C extends Channel<?>> C createChannelInstance(OpenemsComponent component, ChannelId channelId)
      Creates an instance of Channel for the given Channel-ID using its Channel-AbstractDoc.
      Type Parameters:
      C - the type of the Channel
      Parameters:
      component - the OpenemsComponent
      channelId - the Channel-ID
      Returns:
      the Channel