# AdSelectionSignals

Artifact: [androidx.privacysandbox.ads:ads-adservices](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/ads/adservices/common/AdSelectionSignals.kt+class:androidx.privacysandbox.ads.adservices.common.AdSelectionSignals) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

*** ** * ** ***


```
public final class AdSelectionSignals
```

<br />

*** ** * ** ***

This class holds JSON that will be passed into a JavaScript function during ad selection. Its contents are not used by [FLEDGE]("https://developer.android.com/design-for-safety/privacy-sandbox/fledge") platform code, but are merely validated and then passed to the appropriate JavaScript ad selection function.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#AdSelectionSignals(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html signals)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` Compares this AdSelectionSignals to the specified object. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#getSignals()()` Any valid JSON string to create the AdSelectionSignals with. |
| `int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#hashCode()()` Returns a hash code corresponding to the string representation of this class obtained by calling .toString. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#toString()()` |

## Public constructors

### AdSelectionSignals

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public AdSelectionSignals(@NonNull String signals)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html signals` | Any valid JSON string to create the AdSelectionSignals with. |

## Public methods

### equals

```
public boolean equals(Object other)
```

Compares this AdSelectionSignals to the specified object. The result is true if and only if the argument is not null and the signals property of the two objects are equal. Note that this method will not perform any JSON normalization so two AdSelectionSignals objects with the same JSON could be not equal if the String representations of the objects was not equal.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html other` | The object to compare this AdSelectionSignals against |

| Returns |
|---|---|
| `boolean` | true if the given object represents an AdSelectionSignals equivalent to this AdSelectionSignals, false otherwise |

### getSignals

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public final @NonNull String getSignals()
```

Any valid JSON string to create the AdSelectionSignals with.

### hashCode

```
public int hashCode()
```

Returns a hash code corresponding to the string representation of this class obtained by calling .toString. Note that this method will not perform any JSON normalization so two AdSelectionSignals objects with the same JSON could have different hash codes if the underlying string representation was different.

| Returns |
|---|---|
| `int` | a hash code value for this object. |

### toString

```
public @NonNull String toString()
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | The String form of the JSON wrapped by this class. |