# AttributeEntry

Artifact: [androidx.tracing:tracing](https://developer.android.com/jetpack/androidx/releases/tracing) [View Source](https://cs.android.com/search?q=file:androidx/tracing/AttributeEntry.kt+class:androidx.tracing.AttributeEntry) Added in [2.0.5](https://developer.android.com/jetpack/androidx/releases/tracing#2.0.5)

*** ** * ** ***


```
@DelicateTracingApi
public final class AttributeEntry
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/androidx/tracing/TraceEvent`s can contain trace attributes that apply to the entire trace. This is how that metadata is sent to the `https://developer.android.com/reference/androidx/tracing/AbstractTraceSink`. These objects are pooled, and we expose bare-fields because this is performance sensitive code.

End users of tracing will never use this class directly. They will only interact with it using `https://developer.android.com/reference/androidx/tracing/TraceEventScope`.

An `https://developer.android.com/reference/androidx/tracing/AttributeEntry` should only have one of `https://developer.android.com/reference/androidx/tracing/AttributeEntry#longValue()`, or `https://developer.android.com/reference/androidx/tracing/AttributeEntry#stringValue()` non-null when set. There can **never** be more than one value set.

## Summary

| ### Public fields |
|---|---|
| `final https://developer.android.com/reference/java/lang/Long.html` | `https://developer.android.com/reference/androidx/tracing/AttributeEntry#longValue()` |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/tracing/AttributeEntry#name()` |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/tracing/AttributeEntry#stringValue()` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/tracing/AttributeEntry#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `int` | `https://developer.android.com/reference/androidx/tracing/AttributeEntry#hashCode()()` |
| `final void` | `https://developer.android.com/reference/androidx/tracing/AttributeEntry#reset()()` Resets the fields of the `https://developer.android.com/reference/androidx/tracing/AttributeEntry`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/tracing/AttributeEntry#toString()()` |

## Public fields

### longValue

Added in [2.0.5](https://developer.android.com/jetpack/androidx/releases/tracing#2.0.5)

```
public final Long longValue
```

### name

Added in [2.0.5](https://developer.android.com/jetpack/androidx/releases/tracing#2.0.5)

```
public final String name
```

### stringValue

Added in [2.0.5](https://developer.android.com/jetpack/androidx/releases/tracing#2.0.5)

```
public final String stringValue
```

## Public methods

### equals

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

### hashCode

```
public int hashCode()
```

### reset

Added in [2.0.5](https://developer.android.com/jetpack/androidx/releases/tracing#2.0.5)

```
public final void reset()
```

Resets the fields of the `https://developer.android.com/reference/androidx/tracing/AttributeEntry`. This is done before reusing the object instance in a pool. `https://developer.android.com/reference/androidx/tracing/AbstractTraceSink` authors are not expected to call this method directly; this is automatically done when calling `https://developer.android.com/reference/androidx/tracing/PooledTracePacketArray#recycle()` once the `https://developer.android.com/reference/androidx/tracing/TraceEvent` is serialized.

### toString

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