# AdSelectionSignals

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals "View this page in Java")

<br />

```
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                                                                                                                         |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AdSelectionSignals](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#AdSelectionSignals(kotlin.String))`(signals: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` Compares this AdSelectionSignals to the specified object. |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#hashCode())`()` Returns a hash code corresponding to the string representation of this class obtained by calling .toString.                                          |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#toString())`()`                                                                                                                                                      |

|                               ### Public properties                               |
|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [signals](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals#signals()) Any valid JSON string to create the AdSelectionSignals with. |

## Public constructors

### AdSelectionSignals

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

```
AdSelectionSignals(signals: String)
```  

|                                          Parameters                                          |
|----------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `signals: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | Any valid JSON string to create the AdSelectionSignals with. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

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                                        |
|-----------------------------------------------------------------------------------------|-------------------------------------------------------|
| `other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?` | The object to compare this AdSelectionSignals against |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the given object represents an AdSelectionSignals equivalent to this AdSelectionSignals, false otherwise |

### hashCode

```
open fun hashCode(): Int
```

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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### toString

```
open fun toString(): String
```  

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|----------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | The String form of the JSON wrapped by this class. |

## Public properties

### signals

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

```
val signals: String
```

Any valid JSON string to create the AdSelectionSignals with.