# SocialPostEntity

# SocialPostEntity

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/com/google/android/engage/social/datamodel/SocialPostEntity "View this page in Kotlin")\|Java  

<br />

```
public final class SocialPostEntity extends Entity
```

<br />

|---|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)                                                                                        |||
| ↳ | [com.google.android.engage.common.datamodel.Entity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity)                        ||
|   | ↳ | [com.google.android.engage.social.datamodel.SocialPostEntity](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity) |

*** ** * ** ***

An object representing a social media post.

## Summary

|                                                                                                                                            ### Nested types                                                                                                                                            |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `public final class `[SocialPostEntity.Builder](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity.Builder) Builder class for[SocialPostEntity](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity). |

|                                                                                       ### Public fields                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| `final `[GenericPost](https://developer.android.com/reference/com/google/android/engage/social/datamodel/GenericPost)                                                                          | [genericPost](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#genericPost())   |
| `final `[List](https://developer.android.com/reference/java/util/List.html)`<`[Interaction](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Interaction)`>` | [interactions](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#interactions()) |

|                                                                                          ### Public methods                                                                                          |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html)                                                                                                                                  | [getActionLinkUri](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#getActionLinkUri())`()` Returns the action link uri of the social entity.                            |
| [List](https://developer.android.com/reference/java/util/List.html)`<`[DisplayTimeWindow](https://developer.android.com/reference/com/google/android/engage/common/datamodel/DisplayTimeWindow)`>`   | [getDisplayTimeWindows](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#getDisplayTimeWindows())`()` Returns the display time window associated with the social entity. |
| [Optional](https://guava.dev/releases/21.0/api/docs/com/google/common/base/Optional.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>`                               | [getEntityId](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#getEntityId())`()` Returns the id of the entity.                                                          |
| [GenericPost](https://developer.android.com/reference/com/google/android/engage/social/datamodel/GenericPost)                                                                                        | [getGenericPost](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#getGenericPost())`()` Returns the post related metadata for the social post entity.                    |
| [List](https://developer.android.com/reference/java/util/List.html)`<`[Interaction](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Interaction)`>`               | [getInteractions](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#getInteractions())`()` Returns the interaction metadata for the social post entity.                   |
| [Optional](https://guava.dev/releases/21.0/api/docs/com/google/common/base/Optional.html)`<`[Profile](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Profile)`>` | [getProfile](https://developer.android.com/reference/com/google/android/engage/social/datamodel/SocialPostEntity#getProfile())`()` Returns the profile metadata for the social post entity.                                 |

|                                                                                                                                                                                                          ### Inherited methods                                                                                                                                                                                                           |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[com.google.android.engage.common.datamodel.Entity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity) |-------|--------------------------------------------------------------------------------------------------------------------------------| | `int` | [getEntityType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity#getEntityType())`()` | |

## Public fields

### genericPost

```
public final GenericPost genericPost
```  

### interactions

```
public final List<Interaction> interactions
```  

## Public methods

### getActionLinkUri

```
public Uri getActionLinkUri()
```

Returns the action link uri of the social entity.  

### getDisplayTimeWindows

```
public List<DisplayTimeWindow> getDisplayTimeWindows()
```

Returns the display time window associated with the social entity.

This can be used for several use cases like offer expiry time window, preorder availability time window.  

### getEntityId

```
public Optional<String> getEntityId()
```

Returns the id of the entity.  

### getGenericPost

```
public GenericPost getGenericPost()
```

Returns the post related metadata for the social post entity.  

### getInteractions

```
public List<Interaction> getInteractions()
```

Returns the interaction metadata for the social post entity.  

### getProfile

```
public Optional<Profile> getProfile()
```

Returns the profile metadata for the social post entity.