OptionUpdateRule

public 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 Collections or Maps.

Summary

Enum values

OptionUpdateRule  FIRST

once an option is set, subsequent attempts to update it should be ignored. 

OptionUpdateRule  GREATEST

for Comparable options, keep the one that compares as the greatest. 

OptionUpdateRule  IMMUTABLE

throw a ConfigurationException if this option is set more than once. 

OptionUpdateRule  LAST

if an option is set multiple times, ignore all but the last value. 

OptionUpdateRule  LEAST

for Comparable options, keep the one that compares as the least. 

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

OptionUpdateRule FIRST

once an option is set, subsequent attempts to update it should be ignored.

GREATEST

OptionUpdateRule GREATEST

for Comparable options, keep the one that compares as the greatest.

IMMUTABLE

OptionUpdateRule IMMUTABLE

throw a ConfigurationException if this option is set more than once.

LAST

OptionUpdateRule LAST

if an option is set multiple times, ignore all but the last value.

LEAST

OptionUpdateRule LEAST

for Comparable options, keep the one that compares as the least.

Public methods

shouldUpdate

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

OptionUpdateRule valueOf (String name)

Parameters
name String

Returns
OptionUpdateRule

values

OptionUpdateRule[] values ()

Returns
OptionUpdateRule[]