Class SeriesIndependentFactory<COMPONENT,DEFINITION extends AbstractDefinition<DEFINITION>,INFO extends AbstractInfo,SUMMARY extends SummaryInfo>
java.lang.Object
com.inet.taskplanner.server.api.common.AbstractFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
com.inet.taskplanner.server.api.common.SeriesIndependentFactory<COMPONENT,DEFINITION,INFO,SUMMARY>
- 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 Summary
ConstructorsConstructorDescriptionSeriesIndependentFactory
(String extensionName) Creates a new SeriesFactory instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal COMPONENT
createFrom
(DEFINITION definition, @Nullable com.inet.id.GUID taskID) Creates a concrete object to be used byTaskPlanner
from given definition.updateValues
(DEFINITION definition, com.inet.id.GUID taskID) Update values according to the give definition.abstract void
validate
(DEFINITION definition, com.inet.id.GUID taskID) Validate the given definition.Methods inherited from class com.inet.taskplanner.server.api.common.AbstractFactory
checkDefinitionArgument, createInstanceFrom, createInstanceFrom, getExtensionName, getInformation, getSummary, isAvailable
-
Constructor Details
-
SeriesIndependentFactory
Creates a new SeriesFactory instance.- Parameters:
extensionName
- unique name for this kind of components- Since:
- taskplanner 3.0
-
-
Method Details
-
validate
public abstract void validate(@Nonnull DEFINITION definition, com.inet.id.GUID taskID) throws ValidationException Validate the given definition.The given definition is guaranteed to belong to this factory
- Specified by:
validate
in classAbstractFactory<COMPONENT,
DEFINITION extends AbstractDefinition<DEFINITION>, INFO extends AbstractInfo, SUMMARY extends SummaryInfo> - Parameters:
definition
- the definition to validatetaskID
- 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.- Throws:
ValidationException
- if the component has some errors
-
createFrom
public final COMPONENT createFrom(DEFINITION definition, @Nullable @Nullable com.inet.id.GUID taskID) Creates a concrete object to be used byTaskPlanner
from given definition.- Parameters:
definition
- holds information about the component to createtaskID
- 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:
IllegalArgumentException
- if definition is null or the definition's extension name does not match this factory's extension name.- Since:
- taskplanner 3.0
-
updateValues
Update values according to the give definition.The given definition is guaranteed to belong to this factory
- Parameters:
definition
- the definition with the current propertiestaskID
- 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
-