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 |
escapeDisabled(Object obj)
Escapes the parameter value, removing the :disabled suffix.
|
static String |
escapeSelected(Object obj)
Escapes the parameter value, removing the :selected suffix.
|
static String |
escapeSelectedAndDisabled(Object obj)
Escapes the parameter value, removing the :selected and :disabled suffixes.
|
static 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<BuildWrapper,List<ParameterDefinition>> |
getBuildWrapperParameterDefinitions(Project<?,?> project)
Get parameter definitions associated with
BuildWrappers of the given Project. |
static Map<String,Object> |
getGlobalNodeProperties()
Get a map with the global node properties.
|
static Project<?,?> |
getProjectByName(String projectName)
Deprecated.
The choice is arbitrary if there are multiple matches; use
Item.getFullName() and Jenkins.getItemByFullName(String, Class) instead. |
static List<ParameterDefinition> |
getProjectParameterDefinitions(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 |
isDisabled(Object obj)
Checks whether a parameter value contains the :disabled suffix, returning
true if it does, false otherwise. |
static boolean |
isSelected(Object obj)
Checks whether a parameter value contains the :selected suffix, returning
true if it does, false otherwise. |
protected static final Logger LOGGER
@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 valuepublic static boolean isDisabled(@Nullable Object obj)
true if it does, false otherwise.obj - parameter valuetrue if the parameter name contains the :disabled suffix false otherwise.@Nonnull public static String escapeDisabled(@Nullable Object obj)
obj - parameter value@Nonnull public static String escapeSelectedAndDisabled(@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 Project<?,?> getProjectByName(@Nonnull String projectName)
Item.getFullName() and Jenkins.getItemByFullName(String, Class) instead.projectName - project name in Jenkinsnull if none with this name@CheckForNull public static Project findProjectByParameterUUID(@Nonnull String parameterUUID)
parameterUUID - parameter UUIDnull if the current project cannot be found@Nonnull public static List<ParameterDefinition> getProjectParameterDefinitions(@Nonnull Project<?,?> project)
project - the project for which the parameter definitions should be found@Nonnull public static Map<String,Object> getGlobalNodeProperties()
@Nonnull public static Map<BuildWrapper,List<ParameterDefinition>> getBuildWrapperParameterDefinitions(@Nonnull Project<?,?> project)
BuildWrappers of the given Project.project - the project for which the parameter definitions should be foundCopyright © 2016–2020. All rights reserved.