# MediaRouteProviderDescriptor

# MediaRouteProviderDescriptor

Artifact:[androidx.mediarouter:mediarouter](https://developer.android.com/jetpack/androidx/releases/mediarouter)  
[View Source](https://cs.android.com/search?q=file:androidx/mediarouter/media/MediaRouteProviderDescriptor.java+class:androidx.mediarouter.media.MediaRouteProviderDescriptor)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/mediarouter/media/MediaRouteProviderDescriptor "View this page in Java")

<br />

```
class MediaRouteProviderDescriptor
```

<br />

*** ** * ** ***

Describes the state of a media route provider and the routes that it publishes.

This object is immutable once created using a[Builder](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor.Builder)instance.

## Summary

|                                                                                                                                                 ### Nested types                                                                                                                                                  |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[MediaRouteProviderDescriptor.Builder](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor.Builder) Builder for[MediaRouteProviderDescriptor](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor). |

|                                                                                                                                                       ### Public functions                                                                                                                                                       |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                                                                                                                                                                                                                                         | [asBundle](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor#asBundle())`()` Converts this object to a bundle for serialization.                                                                                                                                                  |
| `java-static `[MediaRouteProviderDescriptor](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor)`?`                                                                                                                                                                          | [fromBundle](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor#fromBundle(android.os.Bundle))`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?)` Creates an instance from a bundle.                                                           |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaRouteDescriptor](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteDescriptor)`!>` | [getRoutes](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor#getRoutes())`()` Gets the list of all routes that this provider has published.                                                                                                                                      |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                              | [isValid](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor#isValid())`()` Returns true if the route provider descriptor and all of the routes that it contains have all of the required fields.                                                                                  |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                              | [supportsDynamicGroupRoute](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor#supportsDynamicGroupRoute())`()` Indicates whether a[MediaRouteProvider](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProvider)supports dynamic group route. |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                                | [toString](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor#toString())`()`                                                                                                                                                                                                      |

## Public functions

### asBundle

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun asBundle(): Bundle
```

Converts this object to a bundle for serialization.  

|                                 Returns                                  |
|--------------------------------------------------------------------------|-----------------------------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html) | The contents of the object represented as a bundle. |

### fromBundle

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
java-static fun fromBundle(bundle: Bundle?): MediaRouteProviderDescriptor?
```

Creates an instance from a bundle.  

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|------------------------------|
| `bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?` | The bundle, or null if none. |

|                                                                  Returns                                                                  |
|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [MediaRouteProviderDescriptor](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProviderDescriptor)`?` | The new instance, or null if the bundle was null. |

### getRoutes

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun getRoutes(): (Mutable)List<MediaRouteDescriptor!>
```

Gets the list of all routes that this provider has published.

If it doesn't have any routes, it returns an empty list.  

### isValid

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun isValid(): Boolean
```

Returns true if the route provider descriptor and all of the routes that it contains have all of the required fields.

This verification is deep. If the provider descriptor is known to be valid then it is not necessary to call this method on each of its routes.  

### supportsDynamicGroupRoute

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)  

```
fun supportsDynamicGroupRoute(): Boolean
```

Indicates whether a[MediaRouteProvider](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProvider)supports dynamic group route.  

|                                                                                  See also                                                                                  |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [MediaRouteProvider.DynamicGroupRouteController](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouteProvider.DynamicGroupRouteController) |   |

### toString

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