Apex Reference Guide
Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
ConnectApi.MessageSegment
This class is abstract.
Superclass of:
- ConnectApi.ComplexSegment
- ConnectApi.EntityLinkSegment
- ConnectApi.FieldChangeSegment
- ConnectApi.FieldChangeNameSegment
- ConnectApi.FieldChangeValueSegment
- ConnectApi.HashtagSegment
- ConnectApi.InlineImageSegment
- ConnectApi.LinkSegment
- ConnectApi.MarkupBeginSegment
- ConnectApi.MarkupEndSegment
- ConnectApi.MentionSegment
- ConnectApi.MoreChangesSegment
- ConnectApi.ResourceLinkSegment
- ConnectApi.TextSegment
Message segments in a feed item are typed as ConnectApi.MessageSegment. Feed item capabilities are typed as ConnectApi.FeedItemCapability. Record fields are typed as ConnectApi.AbstractRecordField. These classes are all abstract and have several concrete subclasses. At runtime you can use instanceof to check the concrete types of these objects and then safely proceed with the corresponding downcast. When you downcast, you must have a default case that handles unknown subclasses.
The composition of a feed can change between releases. Write your code to handle instances of unknown subclasses.
Important
| Name | Type | Description | Available Version |
|---|---|---|---|
| text | String | Text-only rendition of this segment. If a client encounters an unknown message segment type, it can render this value. | 28.0 |
| type | ConnectApi.MessageSegmentType Enum | The message segment type. One of these
values:
|
28.0 |