# 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


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

<br />

*** ** * ** ***

Field definition for the generated BuildConfig class.

The field is generated as: = ;

## Summary

| ### Public constructors |
|---|
| `<T : https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html> https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/BuildConfigField#BuildConfigField(kotlin.String,java.io.Serializable,kotlin.String)(type: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, value: T, comment: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?)` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/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. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/BuildConfigField#type()` Value to be written as BuildConfig field type. |
| `T` | `https://developer.android.com/reference/tools/gradle-api/9.6/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 `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/BuildConfigField#(kotlin.String,java.io.Serializable,kotlin.String)` is `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html`, then `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/BuildConfigField#(kotlin.String,java.io.Serializable,kotlin.String)` should include quotes.