OptionUpdateRule
public
final
enum
OptionUpdateRule
extends Enum<OptionUpdateRule>
java.lang.Object | ||
↳ | java.lang.Enum<com.android.tradefed.config.OptionUpdateRule> | |
↳ | com.android.tradefed.config.OptionUpdateRule |
Controls the behavior when an option is specified multiple times. Note that this enum assumes
that the values to be set are not ERROR(/Collection)
s or ERROR(/Map)
s.
Summary
Enum values | |
---|---|
OptionUpdateRule |
FIRST
once an option is set, subsequent attempts to update it should be ignored. |
OptionUpdateRule |
GREATEST
for |
OptionUpdateRule |
IMMUTABLE
throw a |
OptionUpdateRule |
LAST
if an option is set multiple times, ignore all but the last value. |
OptionUpdateRule |
LEAST
for |
Public methods | |
---|---|
boolean
|
shouldUpdate(String optionName, Object optionSource, Field field, Object update)
Takes the current value and the update value, and returns whether the value should be updated. |
static
OptionUpdateRule
|
valueOf(String name)
|
static
final
OptionUpdateRule[]
|
values()
|
Enum values
FIRST
public static final OptionUpdateRule FIRST
once an option is set, subsequent attempts to update it should be ignored.
GREATEST
public static final OptionUpdateRule GREATEST
for Comparable
options, keep the one that compares as the greatest.
IMMUTABLE
public static final OptionUpdateRule IMMUTABLE
throw a ConfigurationException
if this option is set more than once.
LAST
public static final OptionUpdateRule LAST
if an option is set multiple times, ignore all but the last value.
LEAST
public static final OptionUpdateRule LEAST
for Comparable
options, keep the one that compares as the least.
Public methods
shouldUpdate
public boolean shouldUpdate (String optionName, Object optionSource, Field field, Object update)
Takes the current value and the update value, and returns whether the value should be
updated. Assumes that update
is never null.
Parameters | |
---|---|
optionName |
String |
optionSource |
Object |
field |
Field |
update |
Object |
Returns | |
---|---|
boolean |
Throws | |
---|---|
ConfigurationException |
valueOf
public static OptionUpdateRule valueOf (String name)
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
OptionUpdateRule |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-07-19 UTC.