Stay organized with collections
Save and categorize content based on your preferences.
RowBuilder
open class RowBuilder
Builds a row of values using either of these approaches:
- Values can be added with explicit column ordering using
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)
. 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
.
Summary
Public methods
add
open fun add(columnValue: Any!): MatrixCursor.RowBuilder!
Sets the next column value in this row.
Exceptions |
android.database.CursorIndexOutOfBoundsException |
if you try to add too many values |
add
open fun add(
columnName: String!,
value: Any!
): MatrixCursor.RowBuilder!
Offer value for possible inclusion if this cursor defines the given column. Columns not defined by the cursor are silently ignored.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MatrixCursor.RowBuilder\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRowBuilder\n==========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/database/MatrixCursor.RowBuilder \"View this page in Java\") \n\n```\nopen class RowBuilder\n```\n\n|---|-----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.database.MatrixCursor.RowBuilder](#) |\n\nBuilds a row of values using either of these approaches:\n\n- Values can be added with explicit column ordering using [add(java.lang.Object)](#add(kotlin.Any)), 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.\n- Column and value pairs can be offered for possible inclusion using [add(java.lang.String,java.lang.Object)](#add(kotlin.String,%20kotlin.Any)). 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.\n\nUndefined values are left as `null`.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [MatrixCursor.RowBuilder](#)! | [add](#add(kotlin.Any))`(`columnValue:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` Sets the next column value in this row. |\n| open [MatrixCursor.RowBuilder](#)! | [add](#add(kotlin.String,%20kotlin.Any))`(`columnName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` Offer value for possible inclusion if this cursor defines the given column. |\n\nPublic methods\n--------------\n\n### add\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun add(columnValue: Any!): MatrixCursor.RowBuilder!\n```\n\nSets the next column value in this row.\n\n| Return ||\n|-------------------------------|----------------------------------|\n| [MatrixCursor.RowBuilder](#)! | this builder to support chaining |\n\n| Exceptions ||\n|----------------------------------------------------|-----------------------------------|\n| `android.database.CursorIndexOutOfBoundsException` | if you try to add too many values |\n\n### add\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun add(\n columnName: String!, \n value: Any!\n): MatrixCursor.RowBuilder!\n```\n\nOffer value for possible inclusion if this cursor defines the given column. Columns not defined by the cursor are silently ignored.\n\n| Return ||\n|-------------------------------|----------------------------------|\n| [MatrixCursor.RowBuilder](#)! | this builder to support chaining |"]]