public class Utils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
createRandomParameterName(String prefix,
String suffix)
Creates a random parameter name.
|
static String |
escapeSelected(Object obj)
Escapes the parameter value, removing the :selected suffix.
|
static hudson.model.Project |
findProjectByParameterUUID(String parameterUUID)
Find the current project give its parameter UUID.
|
static Set<org.jenkinsci.plugins.scriptler.config.Script> |
getAllScriptlerScripts()
Returns all scriptler scripts available.
|
static Map<String,Object> |
getGlobalNodeProperties()
Get a map with the global node properties.
|
static hudson.model.Project<?,?> |
getProjectByName(String projectName)
Get project in Jenkins given its name.
|
static List<hudson.model.ParameterDefinition> |
getProjectParameterDefinitions(hudson.model.Project project)
Get the parameter definitions for the given project.
|
static Map<String,String> |
getSystemEnv()
Helped method to return the system environment variables.
|
static boolean |
isSelected(Object obj)
Checks whether a parameter value contains the :selected suffix, returning
true if it does, false otherwise. |
@Nonnull public static Set<org.jenkinsci.plugins.scriptler.config.Script> getAllScriptlerScripts()
public static boolean isSelected(@Nullable Object obj)
true
if it does, false
otherwise.obj
- parameter valuetrue
if the parameter name contains the :selected suffix false
otherwise.@Nonnull public static String escapeSelected(@Nullable Object obj)
obj
- parameter value@Nonnull public static String createRandomParameterName(@Nullable String prefix, @Nullable String suffix)
prefix
- parameter prefixsuffix
- parameter suffix@Nonnull public static Map<String,String> getSystemEnv()
@CheckForNull public static hudson.model.Project<?,?> getProjectByName(@Nonnull String projectName)
projectName
- project name in Jenkinsnull
if none with this name@CheckForNull public static hudson.model.Project findProjectByParameterUUID(@Nonnull String parameterUUID)
parameterUUID
- parameter UUIDnull
if the current project cannot be found@Nonnull public static List<hudson.model.ParameterDefinition> getProjectParameterDefinitions(@Nonnull hudson.model.Project project)
project
- the project for which the parameter definitions should be foundCopyright © 2016. All rights reserved.