Class AbstractSource<T,​S>

    • Method Detail

      • uid

        protected String uid()
        Returns universal id of source to be used to construct description().
        universal id of source
      • isMandatory

        protected boolean isMandatory()
      • fireChangeEvent

        protected void fireChangeEvent()
        Fires a change event when source has changed.
      • processLoadedData

        protected AbstractSource.Data<T,​S> processLoadedData​(AbstractSource.Data<T,​S> data)
        Performs any postprocessing of config data after loading. By default, the method simply returns the provided input Data.
        data - an input data
        a post-processed data
      • dataStamp

        protected abstract Optional<S> dataStamp()
        Returns current stamp of data in config source.
        current datastamp of data in config source
      • load

        public final Optional<T> load()
        Loads data from source when data expires.
        Specified by:
        load in interface Source<T>
        the last loaded data
      • loadData

        protected abstract AbstractSource.Data<T,​S> loadData()
                                                            throws ConfigException
        Loads new data from config source.
        newly loaded data with appropriate data timestamp used for future method calls
        ConfigException - in case it is not possible to load configuration data
      • description

        public final String description()
        Description copied from interface: Source
        Short, human-readable summary referring to the underlying source.

        For example, a file path or a URL or any other information that helps the user recognize the underlying origin of the data this Source provides.

        Default is the implementation class simple name with any "Source" suffix removed.

        Specified by:
        description in interface Source<T>
        description of the source