# LinkPreview.Builder

# LinkPreview.Builder

*** ** * ** ***

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

<br />

```
class LinkPreview.Builder
```

<br />

*** ** * ** ***

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

## Summary

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

|                                                          ### Public functions                                                           |
|-----------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [LinkPreview](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview)`!`                 | [build](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview.Builder#build())`()`                                                                                                                                                                                                                                                                                                                                                    |
| [LinkPreview.Builder](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview.Builder)`!` | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setHostname](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview.Builder#setHostname(java.lang.String))`(hostname: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`!)` Sets the text to indicate the link owner, eg "INSIDER".                                         |
| [LinkPreview.Builder](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview.Builder)`!` | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setImage](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview.Builder#setImage(com.google.android.engage.common.datamodel.Image))`(image: `[Image](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/Image)`!)` Sets the hero image for the content on the link. |
| [LinkPreview.Builder](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview.Builder)`!` | `@`[CanIgnoreReturnValue](https://errorprone.info/api/latest/com/google/errorprone/annotations/CanIgnoreReturnValue.html) [setTitle](https://developer.android.com/reference/kotlin/com/google/android/engage/common/datamodel/LinkPreview.Builder#setTitle(java.lang.String))`(title: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`!)` Sets the text to indicate the title of the link.                                                         |

## Public constructors

### Builder

```
Builder()
```  

## Public functions

### build

```
fun build(): LinkPreview!
```  

### setHostname

```
@CanIgnoreReturnValue
fun setHostname(hostname: String!): LinkPreview.Builder!
```

Sets the text to indicate the link owner, eg "INSIDER".

Required.  

### setImage

```
@CanIgnoreReturnValue
fun setImage(image: Image!): LinkPreview.Builder!
```

Sets the hero image for the content on the link.

Optional.  

### setTitle

```
@CanIgnoreReturnValue
fun setTitle(title: String!): LinkPreview.Builder!
```

Sets the text to indicate the title of the link.

Required.