Class Utils
java.lang.Object
org.biouno.unochoice.util.Utils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateRandomParameterName(String prefix, String suffix) Creates a random parameter name.static StringescapeDisabled(Object obj) Escapes the parameter value, removing the :disabled suffix.static StringescapeSelected(Object obj) Escapes the parameter value, removing the :selected suffix.static StringEscapes the parameter value, removing the :selected and :disabled suffixes.static ProjectfindProjectByParameterUUID(String parameterUUID) Find the current project give its parameter UUID.static Map<BuildWrapper, List<ParameterDefinition>> getBuildWrapperParameterDefinitions(Project<?, ?> project) Get parameter definitions associated withBuildWrappers of the givenProject.Get a map with the global node properties.static Project<?, ?> getProjectByName(String projectName) Deprecated.static List<ParameterDefinition> getProjectParameterDefinitions(Project<?, ?> project) Get the parameter definitions for the given project.Helped method to return the system environment variables.static booleanisDisabled(Object obj) Checks whether a parameter value contains the :disabled suffix, returningtrueif it does,falseotherwise.static booleanisSelected(Object obj) Checks whether a parameter value contains the :selected suffix, returningtrueif it does,falseotherwise.
-
Field Details
-
LOGGER
-
-
Method Details
-
isSelected
Checks whether a parameter value contains the :selected suffix, returningtrueif it does,falseotherwise.- Parameters:
obj- parameter value- Returns:
trueif the parameter name contains the :selected suffixfalseotherwise.
-
escapeSelected
-
isDisabled
Checks whether a parameter value contains the :disabled suffix, returningtrueif it does,falseotherwise.- Parameters:
obj- parameter value- Returns:
trueif the parameter name contains the :disabled suffixfalseotherwise.
-
escapeDisabled
-
escapeSelectedAndDisabled
-
createRandomParameterName
-
getSystemEnv
-
getProjectByName
Deprecated.The choice is arbitrary if there are multiple matches; useItem.getFullName()andJenkins.getItemByFullName(String, Class)instead.Get project in Jenkins given its name.- Parameters:
projectName- project name in Jenkins- Returns:
- Project or
nullif none with this name - Since:
- 1.3
-
findProjectByParameterUUID
-
getProjectParameterDefinitions
@NonNull public static List<ParameterDefinition> getProjectParameterDefinitions(@NonNull Project<?, ?> project) Get the parameter definitions for the given project.- Parameters:
project- the project for which the parameter definitions should be found- Returns:
- parameter definitions or an empty list
- Since:
- 1.3
-
getGlobalNodeProperties
-
getBuildWrapperParameterDefinitions
@NonNull public static Map<BuildWrapper, List<ParameterDefinition>> getBuildWrapperParameterDefinitions(@NonNull Project<?, ?> project) Get parameter definitions associated withBuildWrappers of the givenProject.- Parameters:
project- the project for which the parameter definitions should be found- Returns:
- Map
-
Item.getFullName()andJenkins.getItemByFullName(String, Class)instead.