# ContentValues

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# ContentValues

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/content/ContentValues "View this page in Java")  

```
class ContentValues : Parcelable
```

|---|----------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                 ||
| ↳ | [android.content.ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#) |

This class is used to store a set of values that the[ContentResolver](https://developer.android.com/reference/kotlin/android/content/ContentResolver)can process.

## Summary

|                                                                                              Constants                                                                                               ||
|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [TAG](https://developer.android.com/reference/kotlin/android/content/ContentValues#TAG:kotlin.String) <br /> |

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                             Public constructors                                                                                                                                              ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#ContentValues())`()` Creates an empty set of values using the default initial size                                                                                                                           |
| [ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#ContentValues(android.content.ContentValues))`(`from:` `[ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#)!`)` Creates a set of values copied from the given set |
| [ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#ContentValues(kotlin.Int))`(`size:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates an empty set of values using the given initial size                               |

|                                                                                                                                                                                                                                                                                                                                                                       Public methods                                                                                                                                                                                                                                                                                                                                                                       ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [clear](https://developer.android.com/reference/kotlin/android/content/ContentValues#clear())`()` Removes all values.                                                                                                                                                                                                                                  |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                                                                                                 | [containsKey](https://developer.android.com/reference/kotlin/android/content/ContentValues#containsKey(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Returns true if this object has the named value.                                                                                  |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                                                                         | [describeContents](https://developer.android.com/reference/kotlin/android/content/ContentValues#describeContents())`()` <br />                                                                                                                                                                                                                         |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                                                                                                 | [equals](https://developer.android.com/reference/kotlin/android/content/ContentValues#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Indicates whether some other object is "equal to" this one.                                                                                        |
| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!                                                                                                                                                                                                                                                                                                                        | [get](https://developer.android.com/reference/kotlin/android/content/ContentValues#get(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value.                                                                                                                                     |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)!                                                                                                                                                                                                                                                                                                                | [getAsBoolean](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsBoolean(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to a Boolean.                                                                                      |
| [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html)!                                                                                                                                                                                                                                                                                                                      | [getAsByte](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsByte(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to a Byte.                                                                                               |
| [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!                                                                                                                                                                                                                                                                                                           | [getAsByteArray](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsByteArray(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value that is a byte array.                                                                                          |
| [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)!                                                                                                                                                                                                                                                                                                                  | [getAsDouble](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsDouble(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to a Double.                                                                                         |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)!                                                                                                                                                                                                                                                                                                                    | [getAsFloat](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsFloat(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to a Float.                                                                                            |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!                                                                                                                                                                                                                                                                                                                        | [getAsInteger](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsInteger(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to an Integer.                                                                                     |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)!                                                                                                                                                                                                                                                                                                                      | [getAsLong](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsLong(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to a Long.                                                                                               |
| [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html)!                                                                                                                                                                                                                                                                                                                    | [getAsShort](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsShort(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to a Short.                                                                                            |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                                                                                                                                                                                                                                                                                                                  | [getAsString](https://developer.android.com/reference/kotlin/android/content/ContentValues#getAsString(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Gets a value and converts it to a String.                                                                                         |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                                                                         | [hashCode](https://developer.android.com/reference/kotlin/android/content/ContentValues#hashCode())`()` <br />                                                                                                                                                                                                                                         |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                                                                                                 | [isEmpty](https://developer.android.com/reference/kotlin/android/content/ContentValues#isEmpty())`()` Indicates whether this collection is empty.                                                                                                                                                                                                      |
| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>!                                                                                                                                                                                                        | [keySet](https://developer.android.com/reference/kotlin/android/content/ContentValues#keySet())`()` Returns a set of all of the keys                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.ByteArray))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`)` Adds a value to the set. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.Boolean))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)!`)` Adds a value to the set.        |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.Byte))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html)!`)` Adds a value to the set.                 |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.Double))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)!`)` Adds a value to the set.           |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.Float))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)!`)` Adds a value to the set.              |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.Int))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!`)` Adds a value to the set.                    |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.Long))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)!`)` Adds a value to the set.                 |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.Short))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html)!`)` Adds a value to the set.              |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [put](https://developer.android.com/reference/kotlin/android/content/ContentValues#put(kotlin.String,%20kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Adds a value to the set.           |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [putAll](https://developer.android.com/reference/kotlin/android/content/ContentValues#putAll(android.content.ContentValues))`(`other:` `[ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#)!`)` Adds all values from the passed in ContentValues.                                                           |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [putNull](https://developer.android.com/reference/kotlin/android/content/ContentValues#putNull(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Adds a null value to the set.                                                                                                             |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [remove](https://developer.android.com/reference/kotlin/android/content/ContentValues#remove(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Remove a single value.                                                                                                                      |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                                                                         | [size](https://developer.android.com/reference/kotlin/android/content/ContentValues#size())`()` Returns the number of values.                                                                                                                                                                                                                          |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                                                                                                   | [toString](https://developer.android.com/reference/kotlin/android/content/ContentValues#toString())`()` Returns a string containing a concise, human-readable description of this object.                                                                                                                                                              |
| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[MutableEntry](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/-mutable-entry/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!,[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!\>!\>! | [valueSet](https://developer.android.com/reference/kotlin/android/content/ContentValues#valueSet())`()` Returns a set of all of the keys and values                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                                                                                       | [writeToParcel](https://developer.android.com/reference/kotlin/android/content/ContentValues#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`parcel:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />             |

|                                                                                                                                                                       Properties                                                                                                                                                                        ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/content/ContentValues#CREATOR:android.os.Parcelable.Creator) <br /> |

## Constants

### TAG

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val TAG: String
```  

    Value: "ContentValues"

## Public constructors

### ContentValues

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
ContentValues()
```

Creates an empty set of values using the default initial size  

### ContentValues

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
ContentValues(from: ContentValues!)
```

Creates a set of values copied from the given set

|                                                         Parameters                                                         ||
|--------|--------------------------------------------------------------------------------------------------------------------|
| `from` | [ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#)!:the values to copy |

### ContentValues

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
ContentValues(size: Int)
```

Creates an empty set of values using the given initial size

|                                                        Parameters                                                        ||
|--------|------------------------------------------------------------------------------------------------------------------|
| `size` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the initial size of the set of values |

## Public methods

### clear

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun clear(): Unit
```

Removes all values.  

### containsKey

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun containsKey(key: String!): Boolean
```

Returns true if this object has the named value.

|                                                   Parameters                                                    ||
|-------|----------------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to check for |

|                                                               Return                                                               ||
|------------------------------------------------------------------------------------|------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the value is present,`false`otherwise |

### describeContents

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### equals

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun equals(other: Any?): Boolean
```

Indicates whether some other object is "equal to" this one.

The`equals`method implements an equivalence relation on non-null object references:

- It is*reflexive* : for any non-null reference value`x`,`x.equals(x)`should return`true`.
- It is*symmetric* : for any non-null reference values`x`and`y`,`x.equals(y)`should return`true`if and only if`y.equals(x)`returns`true`.
- It is*transitive* : for any non-null reference values`x`,`y`, and`z`, if`x.equals(y)`returns`true`and`y.equals(z)`returns`true`, then`x.equals(z)`should return`true`.
- It is*consistent* : for any non-null reference values`x`and`y`, multiple invocations of`x.equals(y)`consistently return`true`or consistently return`false`, provided no information used in`equals`comparisons on the objects is modified.
- For any non-null reference value`x`,`x.equals(null)`should return`false`.

An equivalence relation partitions the elements it operates on into*equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

|                      Parameters                       ||
|----------|---------------------------------------------|
| `obj`    | the reference object with which to compare. |
| `object` | This value may be`null`.                    |

|                                                                           Return                                                                           ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if this object is the same as the obj argument;`false`otherwise. |

### get

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun get(key: String!): Any!
```

Gets a value. Valid value types are[String](https://developer.android.com/reference/kotlin/java/lang/String.html#),[Boolean](https://developer.android.com/reference/kotlin/java/lang/Boolean.html#),[Number](https://developer.android.com/reference/kotlin/java/lang/Number.html#), and`byte[]`implementations.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                                          Return                                                                                          ||
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | the data for the value, or`null`if the value is missing or if`null`was previously added with the given`key` |

### getAsBoolean

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsBoolean(key: String!): Boolean!
```

Gets a value and converts it to a Boolean.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                             Return                                                                             ||
|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)! | the Boolean value, or`null`if the value is missing or cannot be converted |

### getAsByte

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsByte(key: String!): Byte!
```

Gets a value and converts it to a Byte.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                        Return                                                                         ||
|-------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html)! | the Byte value, or`null`if the value is missing or cannot be converted |

### getAsByteArray

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsByteArray(key: String!): ByteArray!
```

Gets a value that is a byte array. Note that this method will not convert any other types to byte arrays.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                            Return                                                                            ||
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)! | the`byte[]`value, or`null`is the value is missing or not a`byte[]` |

### getAsDouble

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsDouble(key: String!): Double!
```

Gets a value and converts it to a Double.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                           Return                                                                            ||
|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)! | the Double value, or`null`if the value is missing or cannot be converted |

### getAsFloat

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsFloat(key: String!): Float!
```

Gets a value and converts it to a Float.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                          Return                                                                          ||
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)! | the Float value, or`null`if the value is missing or cannot be converted |

### getAsInteger

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsInteger(key: String!): Int!
```

Gets a value and converts it to an Integer.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                         Return                                                                         ||
|-----------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)! | the Integer value, or`null`if the value is missing or cannot be converted |

### getAsLong

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsLong(key: String!): Long!
```

Gets a value and converts it to a Long.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                        Return                                                                         ||
|-------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)! | the Long value, or`null`if the value is missing or cannot be converted |

### getAsShort

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsShort(key: String!): Short!
```

Gets a value and converts it to a Short.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                                          Return                                                                          ||
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html)! | the Short value, or`null`if the value is missing or cannot be converted |

### getAsString

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getAsString(key: String!): String!
```

Gets a value and converts it to a String.

|                                                Parameters                                                 ||
|-------|----------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the value to get |

|                                                   Return                                                    ||
|-----------------------------------------------------------------------------------|--------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | the String for the value |

### hashCode

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hashCode(): Int
```

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### isEmpty

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun isEmpty(): Boolean
```

Indicates whether this collection is empty.

|                                                 Return                                                 ||
|------------------------------------------------------------------------------------|--------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true iff size == 0 |

### keySet

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun keySet(): MutableSet<String!>!
```

Returns a set of all of the keys

|                                                                                                       Return                                                                                                        ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|
| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>! | a set of all of the keys |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: ByteArray!
): Unit
```

Adds a value to the set.

|                                                           Parameters                                                            ||
|---------|------------------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put         |
| `value` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!:the data for the value to put |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: Boolean!
): Unit
```

Adds a value to the set.

|                                                         Parameters                                                         ||
|---------|-------------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put    |
| `value` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)!:the data for the value to put |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: Byte!
): Unit
```

Adds a value to the set.

|                                                       Parameters                                                        ||
|---------|----------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put |
| `value` | [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html)!:the data for the value to put    |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: Double!
): Unit
```

Adds a value to the set.

|                                                        Parameters                                                        ||
|---------|-----------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put  |
| `value` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)!:the data for the value to put |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: Float!
): Unit
```

Adds a value to the set.

|                                                       Parameters                                                        ||
|---------|----------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put |
| `value` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)!:the data for the value to put  |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: Int!
): Unit
```

Adds a value to the set.

|                                                       Parameters                                                        ||
|---------|----------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put |
| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!:the data for the value to put      |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: Long!
): Unit
```

Adds a value to the set.

|                                                       Parameters                                                        ||
|---------|----------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put |
| `value` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)!:the data for the value to put    |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: Short!
): Unit
```

Adds a value to the set.

|                                                       Parameters                                                        ||
|---------|----------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put |
| `value` | [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html)!:the data for the value to put  |

### put

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun put(
    key: String!, 
    value: String!
): Unit
```

Adds a value to the set.

|                                                        Parameters                                                        ||
|---------|-----------------------------------------------------------------------------------------------------------------|
| `key`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to put  |
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the data for the value to put |

### putAll

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun putAll(other: ContentValues!): Unit
```

Adds all values from the passed in ContentValues.

|                                                                  Parameters                                                                   ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------|
| `other` | [ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues#)!:the ContentValues from which to copy |

### putNull

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun putNull(key: String!): Unit
```

Adds a null value to the set.

|                                                         Parameters                                                          ||
|-------|----------------------------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to make null |

### remove

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun remove(key: String!): Unit
```

Remove a single value.

|                                                        Parameters                                                        ||
|-------|-------------------------------------------------------------------------------------------------------------------|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the name of the value to remove |

### size

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun size(): Int
```

Returns the number of values.

|                                              Return                                              ||
|----------------------------------------------------------------------------|----------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the number of values |

### toString

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toString(): String
```

Returns a string containing a concise, human-readable description of this object.

|                                                            Return                                                            ||
|----------------------------------------------------------------------------------|--------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a printable representation of this object. |

### valueSet

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun valueSet(): MutableSet<MutableEntry<String!, Any!>!>!
```

Returns a set of all of the keys and values

|                                                                                                                                                                                                                 Return                                                                                                                                                                                                                 ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<[MutableEntry](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/-mutable-entry/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!,` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!>!>! | a set of all of the keys and values |

### writeToParcel

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun writeToParcel(
    parcel: Parcel, 
    flags: Int
): Unit
```

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | The Parcel in which the object should be written. This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CREATOR: Parcelable.Creator<ContentValues!>
```