added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

ClassPresenterSelector

public final class ClassPresenterSelector
extends PresenterSelector

java.lang.Object
   ↳ android.support.v17.leanback.widget.PresenterSelector
     ↳ android.support.v17.leanback.widget.ClassPresenterSelector


A ClassPresenterSelector selects a Presenter based on the item's Java class.

Summary

Public constructors

ClassPresenterSelector()

Public methods

ClassPresenterSelector addClassPresenter(Class<?> cls, Presenter presenter)

Sets a presenter to be used for the given class.

ClassPresenterSelector addClassPresenterSelector(Class<?> cls, PresenterSelector presenterSelector)

Sets a presenter selector to be used for the given class.

Presenter getPresenter(Object item)

Returns a presenter for the given item.

Presenter[] getPresenters()

Returns an array of all possible presenters.

Inherited methods

From class android.support.v17.leanback.widget.PresenterSelector
From class java.lang.Object

Public constructors

ClassPresenterSelector

added in version 22.1.0
ClassPresenterSelector ()

Public methods

addClassPresenter

added in version 22.1.0
ClassPresenterSelector addClassPresenter (Class<?> cls, 
                Presenter presenter)

Sets a presenter to be used for the given class.

Parameters
cls Class: The data model class to be rendered.

presenter Presenter: The presenter that renders the objects of the given class.

Returns
ClassPresenterSelector This ClassPresenterSelector object.

addClassPresenterSelector

added in version 24.1.0
ClassPresenterSelector addClassPresenterSelector (Class<?> cls, 
                PresenterSelector presenterSelector)

Sets a presenter selector to be used for the given class.

Parameters
cls Class: The data model class to be rendered.

presenterSelector PresenterSelector: The presenter selector that finds the right presenter for a given class.

Returns
ClassPresenterSelector This ClassPresenterSelector object.

getPresenter

added in version 22.1.0
Presenter getPresenter (Object item)

Returns a presenter for the given item.

Parameters
item Object

Returns
Presenter

getPresenters

added in version 24.1.0
Presenter[] getPresenters ()

Returns an array of all possible presenters. The returned array should not be modified.

Returns
Presenter[]