Stay organized with collections
Save and categorize content based on your preferences.
BuildConfigField
class BuildConfigField<T : Serializable?>
Field definition for the generated BuildConfig class.
The field is generated as: = ;
Summary
Public 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
Public 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```\nclass BuildConfigField\u003cT : Serializable?\u003e\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nField definition for the generated BuildConfig class.\n\nThe field is generated as: = ;\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `\u003cT : `[Serializable](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html)`?\u003e `[BuildConfigField](/reference/tools/gradle-api/7.2/com/android/build/api/variant/BuildConfigField#BuildConfigField(kotlin.String,java.io.Serializable,kotlin.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)`?)` |\n\n| ### Public properties ||\n|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [comment](/reference/tools/gradle-api/7.2/com/android/build/api/variant/BuildConfigField#comment()) 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](/reference/tools/gradle-api/7.2/com/android/build/api/variant/BuildConfigField#type()) Value to be written as BuildConfig field type. |\n| `T` | [value](/reference/tools/gradle-api/7.2/com/android/build/api/variant/BuildConfigField#value()) Value of the generated field. |\n\nPublic constructors\n-------------------\n\n### BuildConfigField\n\n```\n\u003cT : Serializable?\u003e BuildConfigField(type: String?, value: T?, comment: String?)\n```\n\nPublic properties\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 is 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. If [type](/reference/tools/gradle-api/7.2/com/android/build/api/variant/BuildConfigField#type()) is [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), then [value](/reference/tools/gradle-api/7.2/com/android/build/api/variant/BuildConfigField#value()) should include quotes."]]