Class AbstractDefinition<T extends AbstractDefinition<T>>

java.lang.Object
com.inet.taskplanner.server.api.common.AbstractDefinition<T>
Type Parameters:
T - type of the definition
Direct Known Subclasses:
JobDefinition, ResultActionDefinition, SeriesDefinition, TriggerDefinition

@JsonData public abstract class AbstractDefinition<T extends AbstractDefinition<T>> extends Object
A definition is a POJO describing a component used by TaskPlanner, see subclasses for details.
Since:
taskplanner 3.0
  • Constructor Details

    • AbstractDefinition

      public AbstractDefinition(@Nonnull @Nonnull String extensionName)
      Creates a new Definition instance.
      Parameters:
      extensionName - the unique type name for this definition. The corresponding factory must have that same extensionName.
      Throws:
      IllegalArgumentException - if given extensionName is null
      Since:
      taskplanner 3.0
    • AbstractDefinition

      public AbstractDefinition(@Nonnull @Nonnull String extensionName, @Nullable @Nullable Map<String,String> properties)
      Creates a new Definition instance.
      Parameters:
      extensionName - the unique type name for this definition. The corresponding factory must have that same extensionName.
      properties - the initial properties to set
      Throws:
      IllegalArgumentException - if given extensionName is null
      Since:
      taskplanner 3.0
  • Method Details

    • getExtensionName

      @Nonnull public final @Nonnull String getExtensionName()
      Get the unique extensionName of the component this definition represents.
      Returns:
      the unique extensionName.
      Since:
      taskplanner 3.0
    • setUid

      public void setUid(com.inet.id.GUID uid)
      Sets the unique identifier of this definition.
      Parameters:
      uid - the unique identifier of this definition.
      Since:
      taskplanner 3.0
    • getUid

      public com.inet.id.GUID getUid()
      Returns the unique identifier of this definition.
      Returns:
      the unique identifier of this definition.
      Since:
      taskplanner 3.0
    • getProperties

      @Nonnull public @Nonnull Map<String,String> getProperties()
      Get the properties object of this definition. Here implementation specific properties for a job, trigger or resultAction are stored.
      NOTE: The returned instance is not a copy. All changes to the returned map will affect this definition directly!
      Returns:
      properties for this definition.
      Since:
      taskplanner 3.0
    • getProperty

      public String getProperty(String key)
      Searches for the property with the specified key in this property list. The method returns null if the property is not found.
      Parameters:
      key - the key of the property
      Returns:
      the value or null if there is no such property
      Since:
      taskplanner 3.0
    • setProperty

      public void setProperty(@Nullable @Nullable String key, @Nullable @Nullable String value)
      Sets a property to the internal properties table. Null values are allowed.
      Parameters:
      key - the key of the property
      value - the value to be set, null will not remove but set null
      Since:
      taskplanner 3.0
    • removeProperty

      public String removeProperty(String key)
      Removes a property of this definition
      Parameters:
      key - the key of the property
      Returns:
      the previously set value
      Since:
      taskplanner 3.0
    • copyDefinition

      @Nonnull public abstract T copyDefinition()
      Makes a deep copy of this definition.
      Returns:
      a deep copy of this definition.
      Since:
      taskplanner 3.0
    • copyDefinitions

      public static <T extends AbstractDefinition<T>> List<T> copyDefinitions(List<T> definitions)
      Returns new list containing copies of the specified definitions which will be created using method copyDefinition().
      Parameters:
      definitions - list of definitions to be copied.
      Returns:
      new list containing copies of the specified definitions.
      Since:
      taskplanner 3.0
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object