class ParameterValuesImpl extends java.lang.Object implements ParameterValues
ParameterValues
interface that
lets a plugin write the job's configuration.Modifier and Type | Field and Description |
---|---|
private PluginConfiguration |
configuration |
private int |
id
The id of the job or configuration.
|
private Job |
job |
private java.util.Map<java.lang.String,java.util.List<?>> |
parameters
Preloaded parameter values, if the write protected flag is set.
|
private java.util.Map<java.lang.String,ParameterType> |
parameterTypes |
private PluginDefinition |
plugin |
private boolean |
writeProtected
The configuration should only be writeable when configuring the job,
not while executing a job.
|
Constructor and Description |
---|
ParameterValuesImpl(Job job,
boolean writeProtected) |
ParameterValuesImpl(PluginConfiguration config,
int version,
boolean writeProtected) |
ParameterValuesImpl(PluginDefinition plugin)
Empty parameter values
|
Modifier and Type | Method and Description |
---|---|
int |
getId()
Get the ID of the job or configuration the parameters
comes from.
|
Job |
getJob()
Get the job that we are executing/configuring.
|
PluginConfiguration |
getPluginConfiguration()
Get the configuration that we are using/configuring.
|
PluginDefinition |
getPluginDefinition()
Get the plugin that we are executing/configuring.
|
java.lang.Object |
getValue(java.lang.String name)
Get a single value for a specific parameter.
|
java.util.List<?> |
getValues(java.lang.String name)
Get a
List of values for a specific parameter. |
(package private) boolean |
isWriteProtected() |
(package private) void |
saveParameters(Job job,
java.util.Map<java.lang.String,PluginParameter<?>> moreInfo) |
(package private) void |
saveParameters(PluginConfiguration config,
java.util.Map<java.lang.String,PluginParameter<?>> moreInfo) |
<T> void |
setValue(java.lang.String name,
ParameterType<T> type,
T value)
Set a single value for a parameter.
|
<T> void |
setValues(java.lang.String name,
ParameterType<T> type,
java.util.List<T> values)
Set a list of values for a parameter.
|
private final int id
private final Job job
private final PluginConfiguration configuration
private final PluginDefinition plugin
private final boolean writeProtected
private final java.util.Map<java.lang.String,java.util.List<?>> parameters
private final java.util.Map<java.lang.String,ParameterType> parameterTypes
ParameterValuesImpl(PluginDefinition plugin)
ParameterValuesImpl(Job job, boolean writeProtected) throws BaseException
BaseException
ParameterValuesImpl(PluginConfiguration config, int version, boolean writeProtected) throws BaseException
BaseException
public Job getJob()
ParameterValues
getJob
in interface ParameterValues
public PluginDefinition getPluginDefinition()
ParameterValues
getPluginDefinition
in interface ParameterValues
public PluginConfiguration getPluginConfiguration()
ParameterValues
getPluginConfiguration
in interface ParameterValues
public int getId()
ParameterValues
getId
in interface ParameterValues
public java.lang.Object getValue(java.lang.String name) throws PermissionDeniedException, BaseException
ParameterValues
ParameterValues.getValues(String)
to return
all values as a list.getValue
in interface ParameterValues
name
- the name of the parameterPermissionDeniedException
- If the logged in user doesn't
have permission to read the valueBaseException
- If there is another errorpublic java.util.List<?> getValues(java.lang.String name) throws PermissionDeniedException, BaseException
ParameterValues
List
of values for a specific parameter.getValues
in interface ParameterValues
name
- The name of the parameterPermissionDeniedException
- If the logged in user doesn't
have permission to read the valuesBaseException
- If there is another errorpublic <T> void setValue(java.lang.String name, ParameterType<T> type, T value) throws PermissionDeniedException, InvalidDataException, BaseException
ParameterValues
setValue
in interface ParameterValues
name
- The name of the parametertype
- The type of the valuevalue
- The value to be setPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the value is invalid according
to the settings in the typeBaseException
- If there is another errorpublic <T> void setValues(java.lang.String name, ParameterType<T> type, java.util.List<T> values) throws PermissionDeniedException, InvalidDataException, BaseException
ParameterValues
setValues
in interface ParameterValues
name
- The name of the parametertype
- The type of the valuevalues
- A list containing the valuesPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If any of the values is invalid according
to the settings in the typeBaseException
- If there is another errorboolean isWriteProtected()
void saveParameters(Job job, java.util.Map<java.lang.String,PluginParameter<?>> moreInfo)
void saveParameters(PluginConfiguration config, java.util.Map<java.lang.String,PluginParameter<?>> moreInfo)