Class DeclarativeAgentDescriptor<A extends DeclarativeAgent<A>>
- java.lang.Object
-
- hudson.model.Descriptor<T>
-
- org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescriptor<A>
-
- org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgentDescriptor<A>
-
public abstract class DeclarativeAgentDescriptor<A extends DeclarativeAgent<A>> extends WithScriptDescriptor<A>
Descriptor forDeclarativeAgent.- Author:
- Andrew Bayer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description DeclarativeAgentDescriptor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExtensionList<DeclarativeAgentDescriptor>all()Get allDeclarativeAgentDescriptors.static List<DeclarativeAgentDescriptor>allSorted()Get allDeclarativeAgentDescriptors, sorted by name.static DeclarativeAgentDescriptorbyName(String name)Get the descriptor for a given name or null if not found.static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel>getDescribableModels()Get a map of name-to-DescribableModelof all known/registered descriptors.static DeclarativeAgent<?>instanceForDescriptor(DeclarativeAgentDescriptor<?> descriptor, Map<String,Object> arguments)For a given descriptor and map of arguments, return an instance using those arguments.static DeclarativeAgent<?>instanceForName(String name, Map<String,Object> arguments)For a given name and map of arguments, find the corresponding descriptor and return an instance using those arguments.static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel>noRequiredArgsModels()Get the map of the subset of descriptors with no required arguments.static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel>zeroArgModels()Get the map of the subset of descriptors with no additional arguments - i.e., "none" and "any".-
Methods inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescriptor
getName, getScriptClass, newInstance, newInstance
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
all
public static ExtensionList<DeclarativeAgentDescriptor> all()
Get allDeclarativeAgentDescriptors.- Returns:
- a list of all
DeclarativeAgentDescriptors registered.
-
allSorted
public static List<DeclarativeAgentDescriptor> allSorted()
Get allDeclarativeAgentDescriptors, sorted by name.- Returns:
- a list of all
DeclarativeAgentDescriptors registered, sorted by name.
-
getDescribableModels
public static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel> getDescribableModels()
Get a map of name-to-DescribableModelof all known/registered descriptors.- Returns:
- A map of name-to-
DescribableModels
-
zeroArgModels
public static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel> zeroArgModels()
Get the map of the subset of descriptors with no additional arguments - i.e., "none" and "any".- Returns:
- A map of descriptors with no arguments.
-
noRequiredArgsModels
public static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel> noRequiredArgsModels()
Get the map of the subset of descriptors with no required arguments.- Returns:
- A map of descriptors with no required arguments.
-
byName
@Nullable public static DeclarativeAgentDescriptor byName(@NonNull String name)
Get the descriptor for a given name or null if not found.- Parameters:
name- The name for the descriptor to look up- Returns:
- The corresponding descriptor or null if not found.
-
instanceForName
@Nullable public static DeclarativeAgent<?> instanceForName(@NonNull String name, Map<String,Object> arguments) throws Exception
For a given name and map of arguments, find the corresponding descriptor and return an instance using those arguments.- Parameters:
name- The name of the descriptorarguments- A map of arguments- Returns:
- The instantiated
DeclarativeAgentinstance, or null if the name isn't found. - Throws:
Exception- if there are issues instantiating from the descriptor
-
instanceForDescriptor
@NonNull public static DeclarativeAgent<?> instanceForDescriptor(@NonNull DeclarativeAgentDescriptor<?> descriptor, Map<String,Object> arguments) throws Exception
For a given descriptor and map of arguments, return an instance using those arguments.- Parameters:
descriptor- The descriptor instancearguments- A map of arguments- Returns:
- The instantiated
DeclarativeAgentinstance. - Throws:
Exception- if there are issues instantiating from the descriptor
-
-