Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for TrainingExampleRecord
Summary
Public constructors
Public methods
build
fun build(): TrainingExampleRecord
Builds the instance. This builder should not be touched after calling this!
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,["# TrainingExampleRecord.Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/ondevicepersonalization/TrainingExampleRecord.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-------------------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.adservices.ondevicepersonalization.TrainingExampleRecord.Builder](#) |\n\nA builder for [TrainingExampleRecord](/reference/kotlin/android/adservices/ondevicepersonalization/TrainingExampleRecord)\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TrainingExampleRecord](/reference/kotlin/android/adservices/ondevicepersonalization/TrainingExampleRecord) | [build](#build())`()` Builds the instance. |\n| [TrainingExampleRecord.Builder](#) | [setResumptionToken](#setResumptionToken(kotlin.Byte))`(`vararg` `value:` `[Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html)`)` The resumption token byte arrays corresponding to training examples. |\n| [TrainingExampleRecord.Builder](#) | [setTrainingExample](#setTrainingExample(kotlin.Byte))`(`vararg` `value:` `[Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html)`)` Training example byte arrays. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): TrainingExampleRecord\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|-------------------------------------------------------------------------------------------------------------|------------------------------|\n| [TrainingExampleRecord](/reference/kotlin/android/adservices/ondevicepersonalization/TrainingExampleRecord) | This value cannot be `null`. |\n\n### setResumptionToken\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setResumptionToken(vararg value: Byte): TrainingExampleRecord.Builder\n```\n\nThe resumption token byte arrays corresponding to training examples. The last processed example's corresponding resumption token will be passed to [android.adservices.ondevicepersonalization.IsolatedWorker#onTrainingExamples](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedWorker#onTrainingExamples(android.adservices.ondevicepersonalization.TrainingExamplesInput,%20android.os.OutcomeReceiver)) to support resumption.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------------|\n| `value` | [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html): This value may be `null`. |\n\n| Return ||\n|------------------------------------|------------------------------|\n| [TrainingExampleRecord.Builder](#) | This value cannot be `null`. |\n\n### setTrainingExample\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setTrainingExample(vararg value: Byte): TrainingExampleRecord.Builder\n```\n\nTraining example byte arrays. The format is a binary serialized [tensorflow.Example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/example/example.proto) proto. The maximum allowed example size is 50KB.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------------|\n| `value` | [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html): This value may be `null`. |\n\n| Return ||\n|------------------------------------|------------------------------|\n| [TrainingExampleRecord.Builder](#) | This value cannot be `null`. |"]]