# SectionedItemList

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/SectionedItemList.java+class:androidx.car.app.model.SectionedItemList) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class SectionedItemList
```

<br />

*** ** * ** ***

Represents an `https://developer.android.com/reference/androidx/car/app/model/ItemList` that is contained inside a section.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/SectionedItemList` | `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList#create(androidx.car.app.model.ItemList,java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/ItemList itemList, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html sectionHeader)` Creates an instance of a `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList` with the given `itemList` and `sectionHeader`. |
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList#getHeader()()` Returns the title of the section. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/ItemList` | `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList#getItemList()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/ItemList` for the section. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList#toString()()` |

## Public methods

### create

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static @NonNull SectionedItemList create(@NonNull ItemList itemList, @NonNull CharSequence sectionHeader)
```

Creates an instance of a `https://developer.android.com/reference/androidx/car/app/model/SectionedItemList` with the given `itemList` and `sectionHeader`.

Only `https://developer.android.com/reference/androidx/car/app/model/DistanceSpan`s and `https://developer.android.com/reference/androidx/car/app/model/DurationSpan`s are supported in the section header.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `sectionHeader` contains unsupported spans |

### equals

```
public boolean equals(@Nullable Object other)
```

### getHeader

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @NonNull CarText getHeader()
```

Returns the title of the section.

### getItemList

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @NonNull ItemList getItemList()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/ItemList` for the section.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```