Class DeclarativeAgentDescriptor<A extends DeclarativeAgent<A>>

    • Constructor Detail

      • DeclarativeAgentDescriptor

        public DeclarativeAgentDescriptor()
    • Method Detail

      • getDescribableModels

        public static Map<String,​org.jenkinsci.plugins.structs.describable.DescribableModel> getDescribableModels()
        Get a map of name-to-DescribableModel of 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 descriptor
        arguments - A map of arguments
        Returns:
        The instantiated DeclarativeAgent instance, 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 instance
        arguments - A map of arguments
        Returns:
        The instantiated DeclarativeAgent instance.
        Throws:
        Exception - if there are issues instantiating from the descriptor