Class EnumConfigurator<T extends Enum<T>>

java.lang.Object
io.jenkins.plugins.casc.impl.configurators.EnumConfigurator<T>
All Implemented Interfaces:
Configurator<T>

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class EnumConfigurator<T extends Enum<T>> extends Object implements Configurator<T>
Author:
Nicolas De Loof
  • Constructor Details

    • EnumConfigurator

      public EnumConfigurator(Class<T> clazz)
  • Method Details

    • getTarget

      public Class getTarget()
      Description copied from interface: Configurator
      Target type this configurator can handle.
      Specified by:
      getTarget in interface Configurator<T extends Enum<T>>
    • describe

      @NonNull public Set<Attribute<T,?>> describe()
      Description copied from interface: Configurator
      Determine the list of Attribute available for configuration of the managed component.
      Specified by:
      describe in interface Configurator<T extends Enum<T>>
      Returns:
      A set of Attributes that describes this object
    • configure

      @NonNull public T configure(CNode config, ConfigurationContext context) throws ConfiguratorException
      Description copied from interface: Configurator
      Configures/creates a Jenkins object based on a tree.
      Specified by:
      configure in interface Configurator<T extends Enum<T>>
      Parameters:
      config - Map/List/primitive objects (think YAML) that represents the configuration from which a Jenkins object is configured.
      context - Fully configured Jenkins object used as the starting point for this configuration.
      Returns:
      Fully configured Jenkins object that results from this configuration. if no new objects got created, but some existing objects may have been modified, return updated target object.
      Throws:
      ConfiguratorException - if something went wrong, depends on the concrete implementation
    • check

      public T check(CNode config, ConfigurationContext context) throws ConfiguratorException
      Description copied from interface: Configurator
      Run the same logic as Configurator.configure(CNode, ConfigurationContext) in dry-run mode. Used to verify configuration is fine before being actually applied to a live jenkins controller.
      Specified by:
      check in interface Configurator<T extends Enum<T>>
      Parameters:
      config - Map/List/primitive objects (think YAML) that represents the configuration from which a Jenkins object is configured.
      context - Fully configured Jenkins object used as the starting point for this configuration.
      Throws:
      ConfiguratorException - on configuration error
    • describe

      @CheckForNull public CNode describe(T instance, ConfigurationContext context) throws Exception
      Description copied from interface: Configurator
      Describe a component as a Configuration Nodes CNode to be exported as yaml. Only export attributes which are not set to default value.
      Specified by:
      describe in interface Configurator<T extends Enum<T>>
      Throws:
      Exception