# PartialCustomAudience.Builder

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 14](https://developer.android.com/sdkExtensions)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/adservices/customaudience/PartialCustomAudience.Builder "View this page in Java")  

```
class Builder
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                     ||
| ↳ | [android.adservices.customaudience.PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#) |

Builder for[PartialCustomAudience](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience)objects.

## Summary

|                                                                                                                                                                                                                                                                       Public constructors                                                                                                                                                                                                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#Builder(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Instantiates a[PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#)with a[String](https://developer.android.com/reference/kotlin/java/lang/String.html#)name for which this Partial Custom Audience will be updated |

|                                                                                                                                                                                                                                                                                                                   Public methods                                                                                                                                                                                                                                                                                                                   ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PartialCustomAudience](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience)                  | [build](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#build())`()` Builds an instance of a[FetchAndJoinCustomAudienceRequest](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest).                                                                                                                                                                              |
| [PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#) | [setActivationTime](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#setActivationTime(java.time.Instant))`(`activationTime:` `[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?`)` Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by which joining the custom audience will be delayed.                                                                |
| [PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#) | [setExpirationTime](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#setExpirationTime(java.time.Instant))`(`expirationTime:` `[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?`)` Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by when the membership to the custom audience will expire.                                                           |
| [PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#) | [setUserBiddingSignals](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#setUserBiddingSignals(android.adservices.common.AdSelectionSignals))`(`userBiddingSignals:` `[AdSelectionSignals](https://developer.android.com/reference/kotlin/android/adservices/common/AdSelectionSignals.html#)?`)` Sets the buyer signals to be consumed by the buyer-provided JavaScript when the custom audience participates in an ad selection. |

## Public constructors

### Builder

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 14](https://developer.android.com/sdkExtensions)  

```
Builder(name: String)
```

Instantiates a[PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#)with a[String](https://developer.android.com/reference/kotlin/java/lang/String.html#)name for which this Partial Custom Audience will be updated

|                                                      Parameters                                                      ||
|--------|--------------------------------------------------------------------------------------------------------------|
| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

## Public methods

### build

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 14](https://developer.android.com/sdkExtensions)  

```
fun build(): PartialCustomAudience
```

Builds an instance of a[FetchAndJoinCustomAudienceRequest](https://developer.android.com/reference/kotlin/android/adservices/customaudience/FetchAndJoinCustomAudienceRequest).

|                                                                            Return                                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [PartialCustomAudience](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience) | This value cannot be`null`. |

|                              Exceptions                              ||
|----------------------------------|------------------------------------|
| `java.lang.NullPointerException` | if any non-null parameter is null. |

### setActivationTime

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 14](https://developer.android.com/sdkExtensions)  

```
fun setActivationTime(activationTime: Instant?): PartialCustomAudience.Builder
```

Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by which joining the custom audience will be delayed.

See[getActivationTime()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience#getActivationTime())for details.

|                                                          Parameters                                                           ||
|------------------|-------------------------------------------------------------------------------------------------------------|
| `activationTime` | [Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?:This value may be`null`. |

|                                                                                    Return                                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#) | This value cannot be`null`. |

### setExpirationTime

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 14](https://developer.android.com/sdkExtensions)  

```
fun setExpirationTime(expirationTime: Instant?): PartialCustomAudience.Builder
```

Sets the[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)by when the membership to the custom audience will expire.

See[getExpirationTime()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience#getExpirationTime())for details.

|                                                          Parameters                                                           ||
|------------------|-------------------------------------------------------------------------------------------------------------|
| `expirationTime` | [Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)?:This value may be`null`. |

|                                                                                    Return                                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#) | This value cannot be`null`. |

### setUserBiddingSignals

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 14](https://developer.android.com/sdkExtensions)  

```
fun setUserBiddingSignals(userBiddingSignals: AdSelectionSignals?): PartialCustomAudience.Builder
```

Sets the buyer signals to be consumed by the buyer-provided JavaScript when the custom audience participates in an ad selection.

See[getUserBiddingSignals()](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience#getUserBiddingSignals())for details.

|                                                                               Parameters                                                                                ||
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| `userBiddingSignals` | [AdSelectionSignals](https://developer.android.com/reference/kotlin/android/adservices/common/AdSelectionSignals.html#)?:This value may be`null`. |

|                                                                                    Return                                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [PartialCustomAudience.Builder](https://developer.android.com/reference/kotlin/android/adservices/customaudience/PartialCustomAudience.Builder#) | This value cannot be`null`. |