# SectionedItemList

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/model/SectionedItemList "View this page in Java")

<br />

```
@CarProtocol
class SectionedItemList
```

<br />

*** ** * ** ***

Represents an[ItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList)that is contained inside a section.

## Summary

|                                                    ### Public functions                                                    |
|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[SectionedItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList) | [create](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList#create(androidx.car.app.model.ItemList,java.lang.CharSequence))`(itemList: `[ItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList)`, sectionHeader: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`)` Creates an instance of a[SectionedItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList)with the given`itemList`and`sectionHeader`. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                        | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                                                                                                                                                         |
| [CarText](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText)                                   | [getHeader](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList#getHeader())`()` Returns the title of the section.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [ItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList)                                 | [getItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList#getItemList())`()` Returns the[ItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList)for the section.                                                                                                                                                                                                                                                                                                                              |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList#hashCode())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                          | [toString](https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemList#toString())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

## Public functions

### create

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

```
java-static fun create(itemList: ItemList, sectionHeader: CharSequence): SectionedItemList
```

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

Only[DistanceSpan](https://developer.android.com/reference/kotlin/androidx/car/app/model/DistanceSpan)s and[DurationSpan](https://developer.android.com/reference/kotlin/androidx/car/app/model/DurationSpan)s are supported in the section header.  

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

### equals

```
fun equals(other: Any?): Boolean
```  

### getHeader

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

```
fun getHeader(): CarText
```

Returns the title of the section.  

### getItemList

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

```
fun getItemList(): ItemList
```

Returns the[ItemList](https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList)for the section.  

### hashCode

```
fun hashCode(): Int
```  

### toString

```
fun toString(): String
```