# Popularity.Builder

# Popularity.Builder

*** ** * ** ***

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

<br />

```
public final class Popularity.Builder
```

<br />

*** ** * ** ***

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

## Summary

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

|                                                     ### Public methods                                                      |
|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Popularity.Builder](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [addVisual](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder#addVisual(com.google.android.engage.common.datamodel.Image))`(`[Image](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Image)` image)` Add an image/icon representing the popularity label.                                                                                             |
| [Popularity.Builder](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [addVisuals](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder#addVisuals(java.util.List<com.google.android.engage.common.datamodel.Image>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[Image](https://developer.android.com/reference/com/google/android/engage/common/datamodel/Image)`> images)` Add the images/icon representing the popularity label. |
| [Popularity](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity)                 | [build](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder#build())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Popularity.Builder](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setCount](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder#setCount(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` count)` Sets the popularity count. e.g. "3.7 M"                                                                                                                                                                      |
| [Popularity.Builder](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setCountValue](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder#setCountValue(long))`(long countValue)` Sets the count value of the popularity.                                                                                                                                                                                                                                        |
| [Popularity.Builder](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder) | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setLabel](https://developer.android.com/reference/com/google/android/engage/social/datamodel/Popularity.Builder#setLabel(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` label)` Sets the popularity label. e.g. "Likes"                                                                                                                                                                      |

## Public constructors

### Builder

```
public Builder()
```  

## Public methods

### addVisual

```
@CanIgnoreReturnValue
public Popularity.Builder addVisual(Image image)
```

Add an image/icon representing the popularity label.

Optional.

If not provided, label must be set.  

### addVisuals

```
@CanIgnoreReturnValue
public Popularity.Builder addVisuals(List<Image> images)
```

Add the images/icon representing the popularity label.

Optional.  

### build

```
public Popularity build()
```  

### setCount

```
@CanIgnoreReturnValue
public Popularity.Builder setCount(String count)
```

Sets the popularity count. e.g. "3.7 M"

Required.  

### setCountValue

```
@CanIgnoreReturnValue
public Popularity.Builder setCountValue(long countValue)
```

Sets the count value of the popularity.

Optional.  

### setLabel

```
@CanIgnoreReturnValue
public Popularity.Builder setLabel(String label)
```

Sets the popularity label. e.g. "Likes"

Optional.

If not provided, visuals must be set.