Class ExecutionContextPopulator
- java.lang.Object
-
- com.perfecto.reportium.model.util.ExecutionContextPopulator
-
public class ExecutionContextPopulator extends Object
Service for automatically updating missing details inJob,ProjectandCustomFieldinstances from environment variables
-
-
Field Summary
Fields Modifier and Type Field Description static StringEQUALSstatic StringINVALID_ENV_CUSTOM_FIELD_ERROR
-
Constructor Summary
Constructors Constructor Description ExecutionContextPopulator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<CustomField>populateMissingCustomFieldsPropertiesFromEnvVariables(Set<CustomField> src)Returns a new Set<CustomField> with both properties as the given source and processed values from a set of predefined environment variables.static JobpopulateMissingJobPropertiesFromEnvVariables(Job src)Returns a newJobwith the same properties as the given source.static ProjectpopulateMissingProjectPropertiesFromEnvVariables(Project src)Returns a newProjectwith the same properties as the given source.
-
-
-
Field Detail
-
INVALID_ENV_CUSTOM_FIELD_ERROR
public static final String INVALID_ENV_CUSTOM_FIELD_ERROR
- See Also:
- Constant Field Values
-
EQUALS
public static final String EQUALS
- See Also:
- Constant Field Values
-
-
Method Detail
-
populateMissingJobPropertiesFromEnvVariables
public static Job populateMissingJobPropertiesFromEnvVariables(Job src)
Returns a newJobwith the same properties as the given source. If the source is missing some properties then this method will try to get values for them based on well-defined environment variable names.- Parameters:
src- job source- Returns:
- New job based on the given source. Properties that are missing in the source
job are read from system variables and populated in the returned value.
Returns
nullif the interpolated job name is empty
-
populateMissingProjectPropertiesFromEnvVariables
public static Project populateMissingProjectPropertiesFromEnvVariables(Project src)
Returns a newProjectwith the same properties as the given source. If the source is missing some properties then this method will try to get values for them based on well-defined environment variable names.- Parameters:
src- project source- Returns:
- New project based on the given source. Properties that are missing in the source
project are read from system variables and populated in the returned value.
Returns
nullif the interpolated project name is empty
-
populateMissingCustomFieldsPropertiesFromEnvVariables
public static Set<CustomField> populateMissingCustomFieldsPropertiesFromEnvVariables(Set<CustomField> src)
Returns a new Set<CustomField> with both properties as the given source and processed values from a set of predefined environment variables. If the source is missing some properties then this method will try to get values for them based on well-defined environment variable names. In case of name duplication the src will be preferred.- Parameters:
src- Set<CustomField>- Returns:
- new Set<CustomField> based on both give src and env variables
-
-