Class AbstractDoc<T>

  • All Implemented Interfaces:
    Doc
    Direct Known Subclasses:
    EnumDoc, OpenemsTypeDoc, StateChannelDoc

    public abstract class AbstractDoc<T>
    extends java.lang.Object
    implements Doc
    Provides static meta information for a Channel using Builder pattern.
    • Constructor Detail

      • AbstractDoc

        protected AbstractDoc​(OpenemsType type)
    • Method Detail

      • self

        protected abstract AbstractDoc<T> self()
        Gets an instance of the correct subclass of myself.
        Returns:
        myself
      • getType

        public OpenemsType getType()
        Description copied from interface: Doc
        Gets the OpenemsType.
        Specified by:
        getType in interface Doc
        Returns:
        the OpenemsType
      • getAccessMode

        public AccessMode getAccessMode()
        Description copied from interface: Doc
        Gets the 'Access-Mode' information
        Specified by:
        getAccessMode in interface Doc
        Returns:
      • persistencePriority

        public AbstractDoc<T> persistencePriority​(PersistencePriority persistencePriority)
        Sets 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.

        Parameters:
        persistencePriority - the PersistencePriority
      • getPersistencePriority

        public PersistencePriority getPersistencePriority()
        Description copied from interface: Doc
        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.

        Specified by:
        getPersistencePriority in interface Doc
        Returns:
        the PersistencePriority
      • initialValue

        public AbstractDoc<T> initialValue​(T initialValue)
        Initial-Value. Default: none
        Parameters:
        initialValue -
        Returns:
        myself
      • getInitialValue

        public T getInitialValue()
        Gets the initial value.
        Returns:
        the initial value
      • text

        public AbstractDoc<T> text​(java.lang.String text)
        Description copied from interface: Doc
        Sets the descriptive text. Defaults to an empty string.
        Specified by:
        text in interface Doc
        Parameters:
        text - the text
        Returns:
        myself
      • getText

        public java.lang.String getText()
        Description copied from interface: Doc
        Gets the descriptive text. Defaults to empty String.
        Specified by:
        getText in interface Doc
        Returns:
        the text
      • getUnit

        public Unit getUnit()
        Description copied from interface: Doc
        Gets the Unit. Defaults to NONE.
        Specified by:
        getUnit in interface Doc
        Returns:
        the unit
      • debug

        public AbstractDoc<T> debug()
        Activates the more verbose debug mode.
        Returns:
        myself
      • isDebug

        public boolean isDebug()
        Description copied from interface: Doc
        Is the more verbose debug mode activated?
        Specified by:
        isDebug in interface Doc
        Returns:
        true for debug mode
      • onInit

        public AbstractDoc<T> onInit​(java.util.function.Consumer<Channel<T>> callback)
        Provides a callback on initialization of the actual Channel
        Parameters:
        callback - the method to call on initialization
        Returns:
        myself
      • getOnInitCallbacks

        protected java.util.List<java.util.function.Consumer<Channel<T>>> getOnInitCallbacks()
        Gets the callbacks for initialization of the actual Channel.
        Returns:
        a list of callbacks