# Topic

# Topic

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/topics/Topic.kt+class:androidx.privacysandbox.ads.adservices.topics.Topic)  
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/topics/Topic "View this page in Java")

<br />

```
class Topic
```

<br />

*** ** * ** ***

Represent the topic result from the getTopics API.

## Summary

|                                                                                                                                                                                                             ### Public constructors                                                                                                                                                                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Topic](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/Topic#Topic(kotlin.Long,kotlin.Long,kotlin.Int))`(taxonomyVersion: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, modelVersion: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, topicId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/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/topics/Topic#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/Topic#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/Topic#toString())`()`                                                                                            |

|                             ### Public properties                             |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [modelVersion](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/Topic#modelVersion()) the version of the model.          |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [taxonomyVersion](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/Topic#taxonomyVersion()) the version of the taxonomy. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)   | [topicId](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/topics/Topic#topicId()) the unique id of a topic.                    |

## Public constructors

### Topic

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

```
Topic(taxonomyVersion: Long, modelVersion: Long, topicId: Int)
```  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| `taxonomyVersion: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | the version of the taxonomy.                                                                                             |
| `modelVersion: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)    | the version of the model.                                                                                                |
| `topicId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)           | the unique id of a topic. See https://developer.android.com/design-for-safety/privacy-sandbox/guides/topics for details. |

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### modelVersion

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

```
val modelVersion: Long
```

the version of the model.  

### taxonomyVersion

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

```
val taxonomyVersion: Long
```

the version of the taxonomy.  

### topicId

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

```
val topicId: Int
```

the unique id of a topic. See https://developer.android.com/design-for-safety/privacy-sandbox/guides/topics for details.