# BuildConfigField

# BuildConfigField

[View Source](https://cs.android.com/search?q=file:com/android/build/api/variant/BuildConfigField.kt+class:com.android.build.api.variant.BuildConfigField)  
Added in 4.2.0  

<br />

```
class BuildConfigField<T : Serializable> : Serializable
```

<br />

*** ** * ** ***

Field definition for the generated BuildConfig class.

The field is generated as:=;

## Summary

|                                                                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                                                                  |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `<T : `[Serializable](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html)`> `[BuildConfigField](https://developer.android.com/reference/tools/gradle-api/8.11/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)`?)` |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [comment](https://developer.android.com/reference/tools/gradle-api/8.11/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. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)    | [type](https://developer.android.com/reference/tools/gradle-api/8.11/com/android/build/api/variant/BuildConfigField#type()) Value to be written as BuildConfig field type.                                                                   |
| `T`                                                                                 | [value](https://developer.android.com/reference/tools/gradle-api/8.11/com/android/build/api/variant/BuildConfigField#value()) Value of the generated field.                                                                                  |

## Public constructors

### BuildConfigField

```
<T : Serializable> BuildConfigField(type: String, value: T, comment: String?)
```  

## Public properties

### comment

Added in 4.2.0  

```
val comment: String?
```

Optional field comment that will be added to the generated source file or null if no comment is necessary.  

### type

Added in 4.2.0  

```
val type: String
```

Value to be written as BuildConfig field type.  

### value

Added in 4.2.0  

```
val value: T
```

Value of the generated field. If[type](https://developer.android.com/reference/tools/gradle-api/8.11/com/android/build/api/variant/BuildConfigField#type())is[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), then[value](https://developer.android.com/reference/tools/gradle-api/8.11/com/android/build/api/variant/BuildConfigField#value())should include quotes.