# FlagSet

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/FlagSet.java+class:androidx.media3.common.FlagSet)

*** ** * ** ***

<br />

```
@UnstableApi
class FlagSet
```

<br />

*** ** * ** ***

A set of integer flags.

Intended for usages where the number of flags may exceed 32 and can no longer be represented by an IntDef.

Instances are immutable.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet.Builder` A builder for `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet` instances. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#contains(int)(flag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns whether the set contains the given flag. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#containsAny(int...)(flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` Returns whether the set contains at least one of the given flags. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#containsAny(androidx.media3.common.FlagSet)(other: https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet!)` Returns whether this FlagSet contains at least one of the flags in the other Flagset. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#get(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the flag at the given index. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#size()()` Returns the number of flags in this set. |

## Public functions

### contains

```
fun contains(flag: Int): Boolean
```

Returns whether the set contains the given flag.

| Parameters |
|---|---|
| `flag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The flag. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the set contains the flag. |

### containsAny

```
fun containsAny(flags: IntArray<Int>!): Boolean
```

Returns whether the set contains at least one of the given flags.

| Parameters |
|---|---|
| `flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` | The flags. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the set contains at least one of the flags. |

### containsAny

```
fun containsAny(other: FlagSet!): Boolean
```

Returns whether this FlagSet contains at least one of the flags in the other Flagset.

| Parameters |
|---|---|
| `other: https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet!` | The flag. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the set contains the flag. |

### equals

```
fun equals(o: Any?): Boolean
```

### get

```
fun get(index: Int): Int
```

Returns the flag at the given index.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index. Must be between 0 (inclusive) and `https://developer.android.com/reference/kotlin/androidx/media3/common/FlagSet#size()` (exclusive). |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The flag at the given index. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException.html` | If index is outside the allowed range. |

### hashCode

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

### size

```
fun size(): Int
```

Returns the number of flags in this set.