Class SeriesIndependentFactory<COMPONENT,​DEFINITION extends AbstractDefinition<DEFINITION>,​INFO extends AbstractInfo,​SUMMARY extends SummaryInfo>

  • All Implemented Interfaces:
    com.inet.plugin.NamedExtension
    Direct Known Subclasses:
    SeriesFactory, TriggerFactory

    public abstract class SeriesIndependentFactory<COMPONENT,​DEFINITION extends AbstractDefinition<DEFINITION>,​INFO extends AbstractInfo,​SUMMARY extends SummaryInfo>
    extends AbstractFactory<COMPONENT,​DEFINITION,​INFO,​SUMMARY>
    Base class for component factories whose properties does not depend on the properties of a possibly configured series. Those are triggers and series.
    Since:
    taskplanner 3.0
    • Constructor Detail

      • SeriesIndependentFactory

        public SeriesIndependentFactory​(java.lang.String extensionName)
        Creates a new SeriesFactory instance.
        Parameters:
        extensionName - unique name for this kind of components
        Since:
        taskplanner 3.0
    • Method Detail

      • createFrom

        public final COMPONENT createFrom​(DEFINITION definition,
                                          @Nullable
                                          com.inet.id.GUID taskID)
        Creates a concrete object to be used by TaskPlanner from given definition.
        Parameters:
        definition - holds information about the component to create
        taskID - the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.
        Returns:
        the created component
        Throws:
        java.lang.IllegalArgumentException - if definition is null or the definition's extension name does not match this factory's extension name.
        Since:
        taskplanner 3.0
      • updateValues

        public java.util.Map<java.lang.String,​java.lang.String> updateValues​(@Nonnull
                                                                                   DEFINITION definition,
                                                                                   com.inet.id.GUID taskID)
        Update values according to the give definition.

        The given definition is guaranteed to belong to this factory

        Parameters:
        definition - the definition with the current properties
        taskID - the ID of the task the definition belongs or will belong to, for optional use
        Returns:
        a map of property key with their values that have changed
        Since:
        taskplanner 3.0