ClassPresenterSelector


class ClassPresenterSelector : PresenterSelector


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

Summary

Public constructors

Public functions

ClassPresenterSelector!
addClassPresenter(cls: Class<Any!>!, presenter: Presenter!)

Sets a presenter to be used for the given class.

ClassPresenterSelector!
addClassPresenterSelector(
    cls: Class<Any!>!,
    presenterSelector: PresenterSelector!
)

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

Presenter?
getPresenter(item: Any?)

Returns a presenter for the given item.

Array<Presenter!>!

Returns an array of all possible presenters.

Public constructors

ClassPresenterSelector

Added in 1.1.0
ClassPresenterSelector()

Public functions

addClassPresenter

Added in 1.1.0
fun addClassPresenter(cls: Class<Any!>!, presenter: Presenter!): ClassPresenterSelector!

Sets a presenter to be used for the given class.

Parameters
cls: Class<Any!>!

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 1.1.0
fun addClassPresenterSelector(
    cls: Class<Any!>!,
    presenterSelector: PresenterSelector!
): ClassPresenterSelector!

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

Parameters
cls: Class<Any!>!

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 1.2.0-alpha04
fun getPresenter(item: Any?): Presenter?

Returns a presenter for the given item.

getPresenters

fun getPresenters(): Array<Presenter!>!

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