Stay organized with collections
Save and categorize content based on your preferences.
BuildConfigField
@Incubating data class BuildConfigField<T : Serializable> : Serializable
Field definition for the generated BuildConfig class.
The field is generated as: = ;
Summary
Public constructors
|
Field definition for the generated BuildConfig class.
|
Properties
|
String? |
Optional field comment that will be added to the generated source file or null if no comment
is necessary.
|
String |
Value to be written as BuildConfig field type.
|
T |
Value of the generated field.
|
Public constructors
<init>
BuildConfigField(
type: String,
value: T,
comment: String?)
Field definition for the generated BuildConfig class.
The field is generated as: = ;
Properties
val comment: String?
Optional field comment that will be added to the generated source file or null if no comment
is necessary.
type
val type: String
Value to be written as BuildConfig field type.
value
val value: T
Value of the generated field.
If type is String, then value should include quotes.
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# BuildConfigField\n================\n\n```\n@Incubating data class BuildConfigField\u003cT : Serializable\u003e : Serializable\n```\n\n|---|-----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [com.android.build.api.variant.BuildConfigField](#) |\n\nField definition for the generated BuildConfig class.\n\nThe field is generated as: = ;\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [\u003cinit\u003e](#%3Cinit%3E(kotlin.String,%20com.android.build.api.variant.BuildConfigField.T,%20kotlin.String))`(`type:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `value:` `T`, `comment:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Field definition for the generated BuildConfig class. |\n\n| ### Properties ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [comment](#comment:kotlin.String) Optional field comment that will be added to the generated source file or null if no comment is necessary. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [type](#type:kotlin.String) Value to be written as BuildConfig field type. |\n| T | [value](#value:com.android.build.api.variant.BuildConfigField.T) Value of the generated field. |\n\nPublic constructors\n-------------------\n\n### \\\u003cinit\\\u003e\n\n```\nBuildConfigField(\n type: String, \n value: T, \n comment: String?)\n```\n\nField definition for the generated BuildConfig class.\n\nThe field is generated as: = ;\n\nProperties\n----------\n\n### comment\n\n```\nval comment: String?\n```\n\nOptional field comment that will be added to the generated source file or null if no comment\nis necessary. \n\n### type\n\n```\nval type: String\n```\n\nValue to be written as BuildConfig field type. \n\n### value\n\n```\nval value: T\n```\n\nValue of the generated field.\nIf [type](#type:kotlin.String) is [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), then [value](#value:com.android.build.api.variant.BuildConfigField.T) should include quotes."]]