Google is committed to advancing racial equity for Black communities. See how.

ListTemplateController

public class ListTemplateController
extends Object

java.lang.Object
   ↳ com.google.android.libraries.car.app.testing.model.ListTemplateController


A controller that allows testing of a ListTemplate.

This controller allows:

Summary

Public methods

ListTemplate get()

Retrieves the ListTemplate that this controller is controlling.

ActionStripController getActionStrip()

Retrieves a ActionStripController for the ActionStrip that is present in the ListTemplate that is being controlled, or null if none is present.

List<ItemListController> getAllItemLists()

Returns a list of ItemListControllers containing all ItemLists included in the ListTemplate that is being controlled.

ActionController getHeaderAction()

Retrieves a ActionController for the header Action that is being controlled, or null if none is present.

ItemListController getItemListByHeader(String header)

Returns an ItemListController for the first ItemList that was added with the given header as its header, or null if none match.

RowController getRowByTitle(String title)

Returns a RowController containing the first Row that was added with the given header as its header, in an ItemList contained in the ListTemplate that is being controlled, or null if none match.

ItemListController getSingleList()

Returns an ItemListController containing the ItemList set via ListTemplate.Builder.setSingleList(ItemList), or null if is is not present.

String getTitle()

Retrieves the title of the ListTemplate that is being controlled, or null if it does not have one.

boolean isLoading()

Returns true if the template is set to be loading.

static ListTemplateController of(ListTemplate listTemplate)

Creates a ListTemplateController to control an ListTemplate for testing.

Inherited methods

Public methods

get

public ListTemplate get ()

Retrieves the ListTemplate that this controller is controlling.

Returns
ListTemplate

getActionStrip

public ActionStripController getActionStrip ()

Retrieves a ActionStripController for the ActionStrip that is present in the ListTemplate that is being controlled, or null if none is present.

Returns
ActionStripController

getAllItemLists

public List<ItemListController> getAllItemLists ()

Returns a list of ItemListControllers containing all ItemLists included in the ListTemplate that is being controlled.

Returns
List<ItemListController>

getHeaderAction

public ActionController getHeaderAction ()

Retrieves a ActionController for the header Action that is being controlled, or null if none is present.

Returns
ActionController

getItemListByHeader

public ItemListController getItemListByHeader (String header)

Returns an ItemListController for the first ItemList that was added with the given header as its header, or null if none match.

The value should be the CharSequence.toString() for the header originally provided.

Parameters
header String

Returns
ItemListController

getRowByTitle

public RowController getRowByTitle (String title)

Returns a RowController containing the first Row that was added with the given header as its header, in an ItemList contained in the ListTemplate that is being controlled, or null if none match.

The value should be the CharSequence.toString() for the title originally provided.

Parameters
title String

Returns
RowController

getSingleList

public ItemListController getSingleList ()

Returns an ItemListController containing the ItemList set via ListTemplate.Builder.setSingleList(ItemList), or null if is is not present.

Returns
ItemListController

getTitle

public String getTitle ()

Retrieves the title of the ListTemplate that is being controlled, or null if it does not have one.

The value returned is the CharSequence.toString() for the title provided.

Returns
String

isLoading

public boolean isLoading ()

Returns true if the template is set to be loading.

This state is set via calling ListTemplate.Builder.setIsLoading(boolean).

Returns
boolean

of

public static ListTemplateController of (ListTemplate listTemplate)

Creates a ListTemplateController to control an ListTemplate for testing.

Parameters
listTemplate ListTemplate

Returns
ListTemplateController