# RecommendationCluster.Builder

# RecommendationCluster.Builder

*** ** * ** ***

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

<br />

```
public final class RecommendationCluster.Builder
```

<br />

*** ** * ** ***

Builder class for[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).

## Summary

|                                                          ### Public constructors                                                          |
|-------------------------------------------------------------------------------------------------------------------------------------------|
| [Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#Builder())`()` |

|                                                                ### Public methods                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [addAllDisplayTimeWindow](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#addAllDisplayTimeWindow(java.util.List<com.google.android.engage.common.datamodel.DisplayTimeWindow>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[DisplayTimeWindow](https://developer.android.com/reference/com/google/android/engage/common/datamodel/DisplayTimeWindow)`> displayTimeWindows)` Adds display time windows for the recommendation cluster.                                                                                                                              |
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [addDisplayTimeWindow](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#addDisplayTimeWindow(com.google.android.engage.common.datamodel.DisplayTimeWindow))`(`[DisplayTimeWindow](https://developer.android.com/reference/com/google/android/engage/common/datamodel/DisplayTimeWindow)` displayTimeWindow)` Adds a display time window for the recommendation cluster.                                                                                                                                                                                                                           |
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [addEntity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#addEntity(com.google.android.engage.common.datamodel.Entity))`(`[Entity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity)` entity)` Add an[Entity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity).                                                                                                                                                                                                                                             |
| [RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster)                 | [build](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#build())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setActionText](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#setActionText(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` actionText)` Set the action text associated with the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).                                                                                                                                                                                                                               |
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setActionUri](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#setActionUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` actionUri)` Set the Uri to which user is navigated to on clicking the action text of the .                                                                                                                                                                                                                                                                                                                                  |
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setRecommendationClusterType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#setRecommendationClusterType(int))`(` ` @`[RecommendationClusterType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationClusterType)` int recommendationClusterType` `)` Sets the[RecommendationClusterType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationClusterType)of the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster). |
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setSubtitle](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#setSubtitle(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` subtitle)` Set the subtitle of the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).                                                                                                                                                                                                                                                     |
| [RecommendationCluster.Builder](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setTitle](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster.Builder#setTitle(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` title)` Set the title of the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).                                                                                                                                                                                                                                                                 |

## Public constructors

### Builder

```
public Builder()
```  

## Public methods

### addAllDisplayTimeWindow

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder addAllDisplayTimeWindow(List<DisplayTimeWindow> displayTimeWindows)
```

Adds display time windows for the recommendation cluster.

Optional.  

### addDisplayTimeWindow

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder addDisplayTimeWindow(DisplayTimeWindow displayTimeWindow)
```

Adds a display time window for the recommendation cluster.

Optional.  

### addEntity

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder addEntity(Entity entity)
```

Add an[Entity](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Entity).

Required.  

### build

```
public RecommendationCluster build()
```  

### setActionText

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder setActionText(String actionText)
```

Set the action text associated with the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).

Optional.  

### setActionUri

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder setActionUri(Uri actionUri)
```

Set the Uri to which user is navigated to on clicking the action text of the .

Optional.  

### setRecommendationClusterType

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder setRecommendationClusterType(
    @RecommendationClusterType int recommendationClusterType
)
```

Sets the[RecommendationClusterType](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationClusterType)of the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).

Optional.  

### setSubtitle

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder setSubtitle(String subtitle)
```

Set the subtitle of the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).

Optional.  

### setTitle

```
@CanIgnoreReturnValue
public RecommendationCluster.Builder setTitle(String title)
```

Set the title of the[RecommendationCluster](https://developer.android.com/reference/com/google/android/engage/common/datamodel/RecommendationCluster).

Required.