Text

Package: com.salesforce.marketingcloud.pushmodels.data

Module: Push Models Module v1.0.2

Platform: androidJvm


Overview 

A data class representing text content in push notifications. Implements Parcelable and PushView interfaces.

1data class Text(
2    val text: String,
3    val style: Style.StyleImpl? = null,
4    val actions: List<Action>? = listOf()
5) : Parcelable, PushView

Constructors 

Text 

1constructor(
2    text: String,
3    style: Style.StyleImpl? = null,
4    actions: List<Action>? = listOf()
5)

Creates a Text instance with the specified content, optional styling, and optional actions.

Parameters:

  • text - The string content to display
  • style - Optional styling configuration (defaults to null)
  • actions - Optional list of actions associated with the text (defaults to empty list)

Properties 

text 

1val text: String

The text content to be displayed.

style 

1open override val style: Style.StyleImpl?

Optional styling configuration for the text appearance.

actions 

1open override val actions: List<Action>?

Optional list of actions that can be triggered from this text element.


Functions 

toString 

1open override fun toString(): String

Returns a string representation of the Text object.

Returns: String representation of this instance


Companion Object 

1object Companion

Companion object for the Text class.


Inheritance 

  • Parcelable - Android parcelable interface for serialization
  • PushView - Interface for push notification view elements