Register now for Android Dev Summit 2019!

RichText

public class RichText
extends Object implements VersionedParcelable

java.lang.Object
   ↳ androidx.car.cluster.navigation.RichText


A RichText is an immutable sequence of graphic elements (e.g.: text, images) to be displayed one after another.

Elements in this sequence are represented by RichTextElement instances.

Each sequence will have a textual representation provided by getText() and in the case of the absence of a rich representation, the sequence of elements getElements() may be left empty. The textual representation may also be used as a fallback for when RichTextElements fail to render.

Summary

Nested classes

class RichText.Builder

Builder for creating a RichText  

Public methods

boolean equals(Object o)
List<RichTextElement> getElements()

Returns the sequence of graphic elements.

String getText()

Returns the plaintext string of this RichText.

int hashCode()
String toString()

Inherited methods

Public methods

equals

public boolean equals (Object o)

Parameters
o Object

Returns
boolean

getElements

public List<RichTextElement> getElements ()

Returns the sequence of graphic elements.

If no rich representation is available, the list may be empty and getText() should be used as a fallback.

Returns
List<RichTextElement>

getText

public String getText ()

Returns the plaintext string of this RichText.

Returns
String

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String