Package org.yamcs

Class Spec.Option

java.lang.Object
org.yamcs.Spec.Option
Enclosing class:
Spec

public static final class Spec.Option extends Object
  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • getType

      public Spec.OptionType getType()
    • isRequired

      public boolean isRequired()
    • isHidden

      public boolean isHidden()
    • isSecret

      public boolean isSecret()
    • getElementType

      public Spec.OptionType getElementType()
    • getTitle

      public String getTitle()
    • getDescription

      public List<String> getDescription()
    • getVersionAdded

      public String getVersionAdded()
    • getDeprecationMessage

      public String getDeprecationMessage()
    • getChoices

      public List<Object> getChoices()
    • getSpec

      public Spec getSpec()
    • isApplySpecDefaults

      public boolean isApplySpecDefaults()
    • getDefaultValue

      public Object getDefaultValue()
    • withTitle

      public Spec.Option withTitle(String title)
    • withDescription

      public Spec.Option withDescription(String... description)
    • withRequired

      public Spec.Option withRequired(boolean required)
      Set whether this option is required.
    • withHidden

      public Spec.Option withHidden(boolean hidden)
      Hint that this option should be hidden from UIs.
    • withSecret

      public Spec.Option withSecret(boolean secret)
      Set whether this option is secret. Secret options are not printed in log files.
    • withDefault

      public Spec.Option withDefault(Object defaultValue)
      Sets the default value. This is used only if the option is not required.
    • withElementType

      public Spec.Option withElementType(Spec.OptionType elementType)
      In case the type is set to Spec.OptionType.LIST or Spec.OptionType.LIST_OR_ELEMENT the element type indicates the type of each element of that list.
    • withVersionAdded

      public Spec.Option withVersionAdded(String versionAdded)
      Which version of the software this specific option was added. For example: "1.2.3". In plugins, this must be the plugin version, not the Yamcs version.
    • withDeprecationMessage

      public Spec.Option withDeprecationMessage(String deprecationMessage)
      Attach a deprecation message to this option.
    • withChoices

      public Spec.Option withChoices(Object... choices)
      Sets the allowed values of this option.
    • withChoices

      public <T extends Enum<T>> Spec.Option withChoices(Class<T> enumClass)
      Sets the allowed values of this option based on the states of an Enum.
    • withAliases

      public Spec.Option withAliases(String... aliases)
      Add aliases for this option. During validation the alias will be converted to the real option name.
    • withSpec

      public Spec.Option withSpec(Spec spec)
      In case the type or the elementType is set to Spec.OptionType.MAP this specifies the options within that map.
    • withApplySpecDefaults

      public Spec.Option withApplySpecDefaults(boolean applySpecDefaults)
      In case the type is set to Spec.OptionType.MAP, setting this property to true will cause defaults within elements of that type to be applied even if the option itself is not defined.

      Note that this is not a recursive property. You need to specify at every level if so required.