Option
public
abstract
@interface
Option
implements
Annotation
com.android.tradefed.config.Option |
Annotates a field as representing a IConfiguration
option.
Summary
Constants | |
---|---|
char |
NO_SHORT_NAME
|
Public methods | |
---|---|
String
|
description()
User friendly description of the option. |
Option.Importance
|
importance()
The importance of the option. |
boolean
|
isTimeVal()
Whether the option represents a time value. |
boolean
|
mandatory()
Whether the option is mandatory or optional. |
String
|
name()
The mandatory unique name for this option. |
boolean
|
requiredForRerun()
Whether the option is needed to compile instruction to rerun a test. |
char
|
shortName()
Optional abbreviated name for option. |
OptionUpdateRule
|
updateRule()
Controls the behavior when an option is specified multiple times. |
Constants
NO_SHORT_NAME
public static final char NO_SHORT_NAME
Constant Value: 48 (0x00000030)
Public methods
description
public String description ()
User friendly description of the option.
Returns | |
---|---|
String |
importance
public Option.Importance importance ()
The importance of the option.
An option deemed 'important' will be displayed in the abbreviated help output. Help for an unimportant option will only be displayed in the full help text.Returns | |
---|---|
Option.Importance |
isTimeVal
public boolean isTimeVal ()
Whether the option represents a time value.
If this is a time value, time-specific suffixes will be parsed. The field
long
or Long
for this flag to be valid. A ConfigurationException
will be thrown otherwise.
The default unit is millis. The configuration framework will accept s
for seconds
(1000 millis), m
for minutes (60 seconds), h
for hours (60 minutes), or
d
for days (24 hours).
Units may be mixed and matched, so long as each unit appears at most once, and so long as
all units which do appear are listed in decreasing order of scale. So, for instance, h
may only appear before m
, and may only appear after d
. As a specific
example, "1d2h3m4s5ms" would be a valid time value, as would "4" or "4ms". All embedded
whitespace is discarded.
Returns | |
---|---|
boolean |
mandatory
public boolean mandatory ()
Whether the option is mandatory or optional.
The configuration framework will throw aConfigurationException
if either of the
following is true of a mandatory field after options have been parsed from all sources:
- The field is
null
. - The field is an empty
ERROR(/Collection)
.
Returns | |
---|---|
boolean |
name
public String name ()
The mandatory unique name for this option.
This will map to a command line argument prefixed with two '-' characters. For example, anOption
with name 'help' would be specified with '--help' on the
command line.
Names may not contain a colon eg ':'.
Returns | |
---|---|
String |
requiredForRerun
public boolean requiredForRerun ()
Whether the option is needed to compile instruction to rerun a test.
Result reporter may try to compile instruction on how to rerun a test and include the message in the result. The instruction shall include all options that applicable to a test rerun. This attribute is used to indicate if the option shall be included in such instruction.
Returns | |
---|---|
boolean |
shortName
public char shortName ()
Optional abbreviated name for option. This will map to a command line argument prefixed with a single '-'. e.g. "-h" where h = shortName. '0' is reserved to mean the option has no shortName.
Returns | |
---|---|
char |
updateRule
public OptionUpdateRule updateRule ()
Controls the behavior when an option is specified multiple times. Note that this rule is
ignored completely for options that are ERROR(/Collection)
s or ERROR(/Map)
s.
Returns | |
---|---|
OptionUpdateRule |