# MatrixCursor.RowBuilder

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder#inhmethods)  

# MatrixCursor.RowBuilder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/database/MatrixCursor.RowBuilder "View this page in Kotlin")\|Java

`
public


class
MatrixCursor.RowBuilder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.database.MatrixCursor.RowBuilder |

<br />

*** ** * ** ***

Builds a row of values using either of these approaches:

- Values can be added with explicit column ordering using[add(java.lang.Object)](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder#add(java.lang.Object)), which starts from the left-most column and adds one column value at a time. This follows the same ordering as the column names specified at cursor construction time.
- Column and value pairs can be offered for possible inclusion using[add(java.lang.String, java.lang.Object)](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder#add(java.lang.String,%20java.lang.Object)). If the cursor includes the given column, the value will be set for that column, otherwise the value is ignored. This approach is useful when matching data to a custom projection.

Undefined values are left as`null`.

<br />

## Summary

|                                                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                                                        ||
|----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[MatrixCursor.RowBuilder](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder) | ` `[add](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder#add(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` columnValue) ` Sets the next column value in this row.                                                                                                                                    |
| ` `[MatrixCursor.RowBuilder](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder) | ` `[add](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder#add(java.lang.String,%20java.lang.Object))`(`[String](https://developer.android.com/reference/java/lang/String)` columnName, `[Object](https://developer.android.com/reference/java/lang/Object)` value) ` Offer value for possible inclusion if this cursor defines the given column. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public methods

### add

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

```
public MatrixCursor.RowBuilder add (Object columnValue)
```

Sets the next column value in this row.

<br />

|           Parameters           ||
|---------------|-----------------|
| `columnValue` | `Object` <br /> |

|                                                                       Returns                                                                        ||
|-------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| [MatrixCursor.RowBuilder](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder) | this builder to support chaining <br /> |

|                                                                             Throws                                                                             ||
|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------|
| [CursorIndexOutOfBoundsException](https://developer.android.com/reference/android/database/CursorIndexOutOfBoundsException) | if you try to add too many values |

### add

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

```
public MatrixCursor.RowBuilder add (String columnName, 
                Object value)
```

Offer value for possible inclusion if this cursor defines the given column. Columns not defined by the cursor are silently ignored.

<br />

|          Parameters           ||
|--------------|-----------------|
| `columnName` | `String` <br /> |
| `value`      | `Object` <br /> |

|                                                                       Returns                                                                        ||
|-------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| [MatrixCursor.RowBuilder](https://developer.android.com/reference/android/database/MatrixCursor.RowBuilder) | this builder to support chaining <br /> |