Class ECtransOption<T>

java.lang.Object
ecmwf.common.ectrans.ECtransOption<T>
Type Parameters:
T - the generic type
All Implemented Interfaces:
ECtransOptionDefinition

public class ECtransOption<T> extends Object implements ECtransOptionDefinition
The Class ECtransOption.
Author:
root
  • Constructor Details

    • ECtransOption

      public ECtransOption(ECtransGroups group, String module, String name, Class<T> clazz, List<T> defaultValues, List<T> choices)
      Instantiates a new ectrans option.
      Parameters:
      group - the group
      module - the module
      name - the name
      clazz - the clazz
      defaultValues - the default values
      choices - the choices
    • ECtransOption

      public ECtransOption(ECtransGroups group, String module, String name, Class<T> clazz, List<T> defaultValues, List<T> choices, List<SubOption> subOptions, boolean freeFormSubOptions)
      Instantiates a new ectrans option, additionally describing the nested key=value entries expected inside its value (as parsed by Options), if any.
      Parameters:
      group - the group
      module - the module
      name - the name
      clazz - the clazz
      defaultValues - the default values
      choices - the choices
      subOptions - the known nested key=value entries, or an empty list if not applicable
      freeFormSubOptions - true if the value holds arbitrary/free-form nested key=value entries (e.g. HTTP headers) rather than a fixed/known set
    • ECtransOption

      public ECtransOption(ECtransGroups group, String module, String name, Class<T> clazz, List<T> defaultValues, List<T> choices, List<SubOption> subOptions, boolean freeFormSubOptions, Properties metadata)
      Builds an option using extension-owned help, visibility and redaction metadata. Metadata keys use the same parameter.tips/visible/secured format as built-in options.
  • Method Details

    • getOption

      public ECtransOption<?> getOption()
      Specified by:
      getOption in interface ECtransOptionDefinition
    • getParameter

      public String getParameter()
      Gets the parameter.
      Specified by:
      getParameter in interface ECtransOptionDefinition
      Returns:
      the parameter
    • getGroup

      public ECtransGroups getGroup()
      Gets the group.
      Specified by:
      getGroup in interface ECtransOptionDefinition
      Returns:
      the group
    • getModule

      public String getModule()
      Gets the module.
      Specified by:
      getModule in interface ECtransOptionDefinition
      Returns:
      the module
    • getName

      public String getName()
      Gets the name.
      Specified by:
      getName in interface ECtransOptionDefinition
      Returns:
      the name
    • getTips

      protected String getTips()
      Gets the tips.
      Returns:
      the tips
    • getClazz

      public Class<T> getClazz()
      Gets the clazz.
      Specified by:
      getClazz in interface ECtransOptionDefinition
      Returns:
      the clazz
    • getComment

      protected String getComment(boolean detailed)
      Gets the comment.
      Parameters:
      detailed - the detailed
      Returns:
      the comment
    • getDefaultValue

      protected T getDefaultValue()
      Gets the default value.
      Returns:
      the default value
    • getDefaultValues

      protected List<T> getDefaultValues()
      Gets the default values.
      Returns:
      the default values
    • getChoices

      protected List<T> getChoices()
      Gets the choices.
      Returns:
      the choices
    • getSubOptions

      public List<SubOption> getSubOptions()
      Gets the known nested key=value entries expected inside this option's value, if any.
      Specified by:
      getSubOptions in interface ECtransOptionDefinition
      Returns:
      the sub options, or an empty list if not applicable
    • hasFreeFormSubOptions

      public boolean hasFreeFormSubOptions()
      Checks if this option's value holds arbitrary/free-form nested key=value entries (e.g. HTTP headers) rather than a fixed/known set described by getSubOptions().
      Specified by:
      hasFreeFormSubOptions in interface ECtransOptionDefinition
      Returns:
      true, if the nested entries are free-form
    • isVisible

      public boolean isVisible()
      Checks if is visible.
      Specified by:
      isVisible in interface ECtransOptionDefinition
      Returns:
      true, if is visible
    • isSecured

      public boolean isSecured()
      Checks if is secured.
      Specified by:
      isSecured in interface ECtransOptionDefinition
      Returns:
      true, if is secured