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 java.lang.Object
A definition is a POJO describing a component used byTaskPlanner
, see subclasses for details.- Since:
- taskplanner 3.0
-
-
Constructor Summary
Constructors Constructor Description AbstractDefinition(java.lang.String extensionName)
Creates a new Definition instance.AbstractDefinition(java.lang.String extensionName, java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new Definition instance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract T
copyDefinition()
Makes a deep copy of this definition.static <T extends AbstractDefinition<T>>
java.util.List<T>copyDefinitions(java.util.List<T> definitions)
Returns new list containing copies of the specified definitions which will be created using methodcopyDefinition()
.boolean
equals(java.lang.Object obj)
java.lang.String
getExtensionName()
Get the unique extensionName of the component this definition represents.java.util.Map<java.lang.String,java.lang.String>
getProperties()
Get the properties object of this definition.java.lang.String
getProperty(java.lang.String key)
Searches for the property with the specified key in this property list.com.inet.id.GUID
getUid()
Returns the unique identifier of this definition.int
hashCode()
java.lang.String
removeProperty(java.lang.String key)
Removes a property of this definitionvoid
setProperty(java.lang.String key, java.lang.String value)
Sets a property to the internal properties table.void
setUid(com.inet.id.GUID uid)
Sets the unique identifier of this definition.
-
-
-
Constructor Detail
-
AbstractDefinition
public AbstractDefinition(@Nonnull java.lang.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:
java.lang.IllegalArgumentException
- if given extensionName is null- Since:
- taskplanner 3.0
-
AbstractDefinition
public AbstractDefinition(@Nonnull java.lang.String extensionName, @Nullable java.util.Map<java.lang.String,java.lang.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:
java.lang.IllegalArgumentException
- if given extensionName is null- Since:
- taskplanner 3.0
-
-
Method Detail
-
getExtensionName
@Nonnull public final java.lang.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 java.util.Map<java.lang.String,java.lang.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 java.lang.String getProperty(java.lang.String key)
Searches for the property with the specified key in this property list. The method returnsnull
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 java.lang.String key, @Nullable java.lang.String value)
Sets a property to the internal properties table. Null values are allowed.- Parameters:
key
- the key of the propertyvalue
- the value to be set,null
will not remove but setnull
- Since:
- taskplanner 3.0
-
removeProperty
public java.lang.String removeProperty(java.lang.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>> java.util.List<T> copyDefinitions(java.util.List<T> definitions)
Returns new list containing copies of the specified definitions which will be created using methodcopyDefinition()
.- 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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-