# BundleSubject

Artifact: [androidx.test.ext:truth](https://developer.android.com/jetpack/androidx/releases/test-ext) [View Source](https://cs.android.com/search?q=file:androidx/test/ext/truth/os/BundleSubject.java+class:androidx.test.ext.truth.os.BundleSubject)

*** ** * ** ***


```
class BundleSubject : Subject
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) ||
|   | ↳ | [androidx.test.ext.truth.os.BundleSubject](https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject) |

*** ** * ** ***

Subject for making assertions about `https://developer.android.com/reference/android/os/Bundle.html`s.

To assert about `https://developer.android.com/reference/android/os/PersistableBundle.html`s, use `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/PersistableBundleSubject`.

## Summary

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#assertThat(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html!)` |
| `java-static https://truth.dev/api/0.41/com/google/common/truth/Subject.Factory.html<https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject!, https://developer.android.com/reference/android/os/Bundle.html!>!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#bundles()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/PrimitiveByteArraySubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#byteArray(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://truth.dev/api/0.41/com/google/common/truth/IterableSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#integerArrayList(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/ParcelableSubject<T!>!` | `<T : https://developer.android.com/reference/android/os/Parcelable.html?> https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#parcelable(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://truth.dev/api/0.41/com/google/common/truth/IterableSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#parcelableArrayList(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `SubjectT!` | `<T : https://developer.android.com/reference/android/os/Parcelable.html?, SubjectT : https://truth.dev/api/0.41/com/google/common/truth/Subject.html?> https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#parcelableAsType(java.lang.String,com.google.common.truth.Subject.Factory<SubjectT,T>)( key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, subjectFactory: https://truth.dev/api/0.41/com/google/common/truth/Subject.Factory.html<SubjectT!, T!>! )` |
| `https://truth.dev/api/0.41/com/google/common/truth/Subject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#serializable(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Returns a truth subject for the value associated with the given key. |
| `https://truth.dev/api/0.41/com/google/common/truth/IterableSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject#stringArrayList(java.lang.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |

### Inherited functions

From [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#actualCustomStringRepresentation--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#equals-java.lang.Object-(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithActual-java.lang.String-java.lang.Object-(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithoutActual-com.google.common.truth.Fact-com.google.common.truth.Fact...-(first: https://truth.dev/api/0.41/com/google/common/truth/Fact.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://truth.dev/api/0.41/com/google/common/truth/Fact.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#hashCode--()`

**This function is deprecated.**
`https://truth.dev/api/0.41/com/google/common/truth/StandardSubjectBuilder.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#ignoreCheck--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isAnyOf-java.lang.Object-java.lang.Object-java.lang.Object...-(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isEqualTo-java.lang.Object-(expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isIn-java.lang.Iterable&lt;?&gt;-(iterable: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-iterable/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isInstanceOf-java.lang.Class&lt;?&gt;-(clazz: https://developer.android.com/reference/java/lang/Class.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNoneOf-java.lang.Object-java.lang.Object-java.lang.Object...-(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotEqualTo-java.lang.Object-(unexpected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotIn-java.lang.Iterable&lt;?&gt;-(iterable: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-iterable/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotInstanceOf-java.lang.Class&lt;?&gt;-(clazz: https://developer.android.com/reference/java/lang/Class.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotNull--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotSameInstanceAs-java.lang.Object-(unexpected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNull--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isSameInstanceAs-java.lang.Object-(expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#toString--()`

## Public functions

### assertThat

```
java-static fun assertThat(bundle: Bundle!): BundleSubject!
```

### bundles

```
java-static fun bundles(): Subject.Factory<BundleSubject!, Bundle!>!
```

### byteArray

```
fun byteArray(key: String!): PrimitiveByteArraySubject!
```

### integerArrayList

```
fun integerArrayList(key: String!): IterableSubject!
```

### parcelable

```
fun <T : Parcelable?> parcelable(key: String!): ParcelableSubject<T!>!
```

### parcelableArrayList

```
fun parcelableArrayList(key: String!): IterableSubject!
```

### parcelableAsType

```
fun <T : Parcelable?, SubjectT : Subject?> parcelableAsType(
    key: String!,
    subjectFactory: Subject.Factory<SubjectT!, T!>!
): SubjectT!
```

### serializable

```
fun serializable(key: String!): Subject!
```

Returns a truth subject for the value associated with the given key.

### stringArrayList

```
fun stringArrayList(key: String!): IterableSubject!
```