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

*** ** * ** ***


```
public final class Topic
```

<br />

*** ** * ** ***

Represent the topic result from the getTopics API.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/Topic#Topic(kotlin.Long,kotlin.Long,kotlin.Int)(long taxonomyVersion, long modelVersion, int topicId)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/Topic#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final long` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/Topic#getModelVersion()()` the version of the model. |
| `final long` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/Topic#getTaxonomyVersion()()` the version of the taxonomy. |
| `final int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/Topic#getTopicId()()` the unique id of a topic. |
| `int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/topics/Topic#hashCode()()` |
| `@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/topics/Topic#toString()()` |

## Public constructors

### Topic

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

```
public Topic(long taxonomyVersion, long modelVersion, int topicId)
```

| Parameters |
|---|---|
| `long taxonomyVersion` | the version of the taxonomy. |
| `long modelVersion` | the version of the model. |
| `int topicId` | the unique id of a topic. See https://developer.android.com/design-for-safety/privacy-sandbox/guides/topics for details. |

## Public methods

### equals

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

### getModelVersion

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

```
public final long getModelVersion()
```

the version of the model.

### getTaxonomyVersion

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

```
public final long getTaxonomyVersion()
```

the version of the taxonomy.

### getTopicId

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

```
public final int getTopicId()
```

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

### hashCode

```
public int hashCode()
```

### toString

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