A partir del 27 de marzo de 2025, te recomendamos que uses android-latest-release
en lugar de aosp-main
para compilar y contribuir a AOSP. Para obtener más información, consulta Cambios en AOSP.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
OptionUpdateRule
public
final
enum
OptionUpdateRule
extends Enum<OptionUpdateRule>
Controla el comportamiento cuando se especifica una opción varias veces. Ten en cuenta que esta enumeración supone que los valores que se establecerán no son ERROR(/Collection)
ni ERROR(/Map)
.
Resumen
Enum. de valores
PRIMERO
public static final OptionUpdateRule FIRST
Una vez que se establece una opción, se deben ignorar los intentos posteriores de actualizarla.
LAST
public static final OptionUpdateRule LAST
Si se establece una opción varias veces, se ignoran todas excepto el último valor.
Métodos públicos
shouldUpdate
public boolean shouldUpdate (String optionName,
Object optionSource,
Field field,
Object update)
Toma el valor actual y el valor de actualización, y muestra si se debe actualizar el valor. Supone que update
nunca es nulo.
Parámetros |
optionName |
String |
optionSource |
Object |
field |
Field |
update |
Object |
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-07-27 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-27 (UTC)"],[],[],null,["# OptionUpdateRule\n================\n\n\n`\npublic\n\nfinal\n\nenum\nOptionUpdateRule\n`\n\n\n`\n\n\n`\n\n`\n\nextends Enum\u003c`[OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html)`\u003e\n\n\n`\n\n`\n\n\n`\n\n|---|---|----------------------------------------------|\n| java.lang.Object |||\n| ↳ | java.lang.Enum\\\u003c[com.android.tradefed.config.OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html)\\\u003e ||\n| | ↳ | com.android.tradefed.config.OptionUpdateRule |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nControls the behavior when an option is specified multiple times. Note that this enum assumes\nthat the values to be set are not [ERROR(/Collection)](../../../../../../)s or [ERROR(/Map)](../../../../../../)s.\n\nSummary\n-------\n\n| ### Enum values ||\n|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | `FIRST` once an option is set, subsequent attempts to update it should be ignored. |\n| [OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | `GREATEST` for [Comparable](../../../../../../reference/tradefed/java/lang/Comparable.html) options, keep the one that compares as the greatest. |\n| [OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | `IMMUTABLE` throw a [ConfigurationException](../../../../../../reference/tradefed/com/android/tradefed/config/ConfigurationException.html) if this option is set more than once. |\n| [OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | `LAST` if an option is set multiple times, ignore all but the last value. |\n| [OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | `LEAST` for [Comparable](../../../../../../reference/tradefed/java/lang/Comparable.html) options, keep the one that compares as the least. |\n\n| ### Public methods ||\n|------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` boolean` | ` `[shouldUpdate](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html#shouldUpdate(java.lang.String,%20java.lang.Object,%20Field,%20java.lang.Object))`(String optionName, Object optionSource, Field field, Object update) ` Takes the current value and the update value, and returns whether the value should be updated. |\n| ` static `[OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | ` `[valueOf](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html#valueOf(java.lang.String))`(String name) ` |\n| ` static final `[OptionUpdateRule[]](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | ` `[values](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html#values())`() ` |\n\nEnum values\n-----------\n\n### FIRST\n\n```\npublic static final OptionUpdateRule FIRST\n```\n\nonce an option is set, subsequent attempts to update it should be ignored.\n\n\u003cbr /\u003e\n\n### GREATEST\n\n```\npublic static final OptionUpdateRule GREATEST\n```\n\nfor [Comparable](../../../../../../reference/tradefed/java/lang/Comparable.html) options, keep the one that compares as the greatest.\n\n\u003cbr /\u003e\n\n### IMMUTABLE\n\n```\npublic static final OptionUpdateRule IMMUTABLE\n```\n\nthrow a [ConfigurationException](../../../../../../reference/tradefed/com/android/tradefed/config/ConfigurationException.html) if this option is set more than once.\n\n\u003cbr /\u003e\n\n### LAST\n\n```\npublic static final OptionUpdateRule LAST\n```\n\nif an option is set multiple times, ignore all but the last value.\n\n\u003cbr /\u003e\n\n### LEAST\n\n```\npublic static final OptionUpdateRule LEAST\n```\n\nfor [Comparable](../../../../../../reference/tradefed/java/lang/Comparable.html) options, keep the one that compares as the least.\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### shouldUpdate\n\n```\npublic boolean shouldUpdate (String optionName, \n Object optionSource, \n Field field, \n Object update)\n```\n\nTakes the current value and the update value, and returns whether the value should be\nupdated. Assumes that `update` is never null.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|-----------------|\n| `optionName` | `String` \u003cbr /\u003e |\n| `optionSource` | `Object` \u003cbr /\u003e |\n| `field` | `Field` \u003cbr /\u003e |\n| `update` | `Object` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n| Throws ||\n|------------------------------------------------------------------------------------------------------------------------|---|\n| [ConfigurationException](../../../../../../reference/tradefed/com/android/tradefed/config/ConfigurationException.html) | |\n\n### valueOf\n\n```\npublic static OptionUpdateRule valueOf (String name)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|-----------------|\n| `name` | `String` \u003cbr /\u003e |\n\n| Returns ||\n|------------------------------------------------------------------------------------------------------------|--------|\n| [OptionUpdateRule](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | \u003cbr /\u003e |\n\n### values\n\n```\npublic static final OptionUpdateRule[] values ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [OptionUpdateRule[]](../../../../../../reference/tradefed/com/android/tradefed/config/OptionUpdateRule.html) | \u003cbr /\u003e |"]]