Package org.yamcs
Class Spec.Option
- java.lang.Object
-
- org.yamcs.Spec.Option
-
-
Constructor Summary
Constructors Constructor Description Option(Spec parentSpec, String name, Spec.OptionType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetDefaultValue()StringgetDeprecationMessage()List<String>getDescription()Spec.OptionTypegetElementType()StringgetName()SpecgetSpec()StringgetTitle()Spec.OptionTypegetType()booleanisRequired()booleanisSecret()Spec.OptionwithAliases(String... aliases)Add aliases for this option.Spec.OptionwithApplySpecDefaults(boolean applySpecDefaults)In case thetypeis set toSpec.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.<T extends Enum<T>>
Spec.OptionwithChoices(Class<T> enumClass)Sets the allowed values of this option based on the states of an Enum.Spec.OptionwithChoices(Object... choices)Sets the allowed values of this option.Spec.OptionwithDefault(Object defaultValue)Sets the default value.Spec.OptionwithDeprecationMessage(String deprecationMessage)Attach a deprecation message to this option.Spec.OptionwithDescription(String... description)Spec.OptionwithElementType(Spec.OptionType elementType)In case thetypeis set toSpec.OptionType.LISTorSpec.OptionType.LIST_OR_ELEMENTthe element type indicates the type of each element of that list.Spec.OptionwithRequired(boolean required)Set whether this option is required.Spec.OptionwithSecret(boolean secret)Set whether this option is secret.Spec.OptionwithSpec(Spec spec)In case thetypeor theelementTypeis set toSpec.OptionType.MAPthis specifies the options within that map.Spec.OptionwithTitle(String title)
-
-
-
Constructor Detail
-
Option
public Option(Spec parentSpec, String name, Spec.OptionType type)
-
-
Method Detail
-
getName
public String getName()
-
getType
public Spec.OptionType getType()
-
isRequired
public boolean isRequired()
-
isSecret
public boolean isSecret()
-
getElementType
public Spec.OptionType getElementType()
-
getTitle
public String getTitle()
-
getDeprecationMessage
public String getDeprecationMessage()
-
getSpec
public Spec getSpec()
-
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.
-
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 thetypeis set toSpec.OptionType.LISTorSpec.OptionType.LIST_OR_ELEMENTthe element type indicates the type of each element of that list.
-
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 thetypeor theelementTypeis set toSpec.OptionType.MAPthis specifies the options within that map.
-
withApplySpecDefaults
public Spec.Option withApplySpecDefaults(boolean applySpecDefaults)
In case thetypeis set toSpec.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.
-
-