Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Archivio valori-chiave mutevoli
public
interface
MutableKeyValueStore
implements
KeyValueStore
android.adservices.ondevicepersonalization.MutableKeyValueStore
|
Un'interfaccia per un archivio chiave-valore di lettura/scrittura.
Utilizzato come oggetto di accesso ai dati per la tabella LOCAL_DATA.
Riepilogo
Metodi pubblici |
abstract
byte[]
|
put(String key, byte[] value)
Associa il valore specificato alla chiave specificata.
|
abstract
byte[]
|
remove(String key)
Rimuove il mapping per la chiave specificata.
|
Metodi pubblici
passami
public abstract byte[] put (String key,
byte[] value)
Associa il valore specificato alla chiave specificata.
Se esiste già un valore per quella chiave, il valore precedente viene sostituito.
Il completamento di questo metodo potrebbe richiedere diversi secondi, quindi
Essere chiamato solo da un thread di lavoro.
Parametri |
key |
String : chiave a cui deve essere associato il valore specificato
Questo valore non può essere null . |
value |
byte : valore da associare alla chiave specificata
Questo valore non può essere null . |
Ritorni |
byte[] |
il valore associato alla chiave precedente o nullo se non esisteva alcuna mappatura per la chiave. |
rimozione
public abstract byte[] remove (String key)
Rimuove il mapping per la chiave specificata.
Il completamento di questo metodo potrebbe richiedere diversi secondi, quindi
Essere chiamato solo da un thread di lavoro.
Parametri |
key |
String : chiave di cui rimuovere la mappatura
Questo valore non può essere null . |
Ritorni |
byte[] |
il valore associato alla chiave precedente o nullo se non esisteva alcuna mappatura per la chiave. |
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# MutableKeyValueStore\n\n[**Added in Android UpsideDownCakePrivacySandbox**](/preview) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nMutableKeyValueStore\n====================\n\n\n`\npublic\n\n\ninterface\nMutableKeyValueStore\n`\n\n\n`\n\n\nimplements\n\n`[KeyValueStore](/design-for-safety/privacy-sandbox/reference/adservices/ondevicepersonalization/KeyValueStore)`\n\n\n`\n\n|-----------------------------------------------------------------|\n| android.adservices.ondevicepersonalization.MutableKeyValueStore |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn interface to a read-write key-value store.\n\nUsed as a Data Access Object for the LOCAL_DATA table. \n**See also:**\n\n- [IsolatedService.getLocalData(RequestToken)](/design-for-safety/privacy-sandbox/reference/adservices/ondevicepersonalization/IsolatedService#getLocalData(android.adservices.ondevicepersonalization.RequestToken))\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract byte[]` | ` `[put](/design-for-safety/privacy-sandbox/reference/adservices/ondevicepersonalization/MutableKeyValueStore#put(java.lang.String,%20byte[]))`(`[String](/reference/java/lang/String)` key, byte[] value) ` Associates the specified value with the specified key. |\n| ` abstract byte[]` | ` `[remove](/design-for-safety/privacy-sandbox/reference/adservices/ondevicepersonalization/MutableKeyValueStore#remove(java.lang.String))`(`[String](/reference/java/lang/String)` key) ` Removes the mapping for the specified key. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[android.adservices.ondevicepersonalization.KeyValueStore](/design-for-safety/privacy-sandbox/reference/adservices/ondevicepersonalization/KeyValueStore)` ` |----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract byte[]` | ` `[get](/design-for-safety/privacy-sandbox/reference/adservices/ondevicepersonalization/KeyValueStore#get(java.lang.String))`(`[String](/reference/java/lang/String)` key) ` Looks up a key in a read-only store. | | ` abstract `[Set](/reference/java/util/Set)`\u003c`[String](/reference/java/lang/String)`\u003e` | ` `[keySet](/design-for-safety/privacy-sandbox/reference/adservices/ondevicepersonalization/KeyValueStore#keySet())`() ` Returns a Set view of the keys contained in the REMOTE_DATA table. | ||\n\nPublic methods\n--------------\n\n### put\n\n[**Added in Android UpsideDownCakePrivacySandbox**](/preview) \n\n```\npublic abstract byte[] put (String key, \n byte[] value)\n```\n\nAssociates the specified value with the specified key.\nIf a value already exists for that key, the old value is replaced.\n\n\u003cbr /\u003e\n\n\nThis method may take several seconds to complete, so it should\nonly be called from a worker thread.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------|\n| `key` | `String`: key with which the specified value is to be associated This value cannot be `null`. \u003cbr /\u003e |\n| `value` | `byte`: value to be associated with the specified key This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|----------|-----------------------------------------------------------------------------------------|\n| `byte[]` | the previous value associated with key, or null if there was no mapping for key. \u003cbr /\u003e |\n\n### remove\n\n[**Added in Android UpsideDownCakePrivacySandbox**](/preview) \n\n```\npublic abstract byte[] remove (String key)\n```\n\nRemoves the mapping for the specified key.\n\n\u003cbr /\u003e\n\n\nThis method may take several seconds to complete, so it should\nonly be called from a worker thread.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|----------------------------------------------------------------------------------|\n| `key` | `String`: key whose mapping is to be removed This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|----------|-----------------------------------------------------------------------------------------|\n| `byte[]` | the previous value associated with key, or null if there was no mapping for key. \u003cbr /\u003e |"]]