2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
OptionUpdateRule
public
final
enum
OptionUpdateRule
extends Enum<OptionUpdateRule>
オプションが複数回指定された場合の動作を制御します。この列挙型は、設定する値が ERROR(/Collection)
または ERROR(/Map)
ではないことを前提としています。
概要
列挙値
LAST
public static final OptionUpdateRule LAST
オプションが複数回設定されている場合、最後の値を除くすべての値は無視されます。
パブリック メソッド
shouldUpdate
public boolean shouldUpdate (String optionName,
Object optionSource,
Field field,
Object update)
現在の値と更新値を受け取り、値を更新する必要があるかどうかを返します。update
が null にならないことを前提としています。
パラメータ |
optionName |
String |
optionSource |
Object |
field |
Field |
update |
Object |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 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 |"]]