# IntFlagMapping

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/view/inspector/IntFlagMapping#pubctors)\|[Methods](https://developer.android.com/reference/android/view/inspector/IntFlagMapping#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/inspector/IntFlagMapping#inhmethods)  

# IntFlagMapping

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/inspector/IntFlagMapping "View this page in Kotlin")\|Java

`
public

final

class
IntFlagMapping
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|---------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.inspector.IntFlagMapping |

<br />

*** ** * ** ***

Maps the values of an`int`property to sets of string for properties that encode flags. An[InspectionCompanion](https://developer.android.com/reference/android/view/inspector/InspectionCompanion)may provide an instance of this class to a[PropertyMapper](https://developer.android.com/reference/android/view/inspector/PropertyMapper)for flag values packed into primitive`int`properties. Each flag has a mask and a target value, for non-exclusive flags, the target can also be used as the mask. A given integer value is compared against each flag to find what flags are active for it by bitwise anding it with the mask and comparing the result against the target, that is,`(value & mask) == target`.  
**See also:**

- [PropertyMapper.mapIntFlag(String, int, java.util.function.IntFunction)](https://developer.android.com/reference/android/view/inspector/PropertyMapper#mapIntFlag(java.lang.String,%20int,%20java.util.function.IntFunction<java.util.Set<java.lang.String>>))

## Summary

|                                                   ### Public constructors                                                   ||
|--------------------------------------------------------------------------------------------------------------------------|---|
| ` `[IntFlagMapping](https://developer.android.com/reference/android/view/inspector/IntFlagMapping#IntFlagMapping())`() ` |

|                                                                                                                                                                                                 ### Public methods                                                                                                                                                                                                 ||
|-----------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                                                                 | ` `[add](https://developer.android.com/reference/android/view/inspector/IntFlagMapping#add(int,%20int,%20java.lang.String))`(int mask, int target, `[String](https://developer.android.com/reference/java/lang/String)` name) ` Add a mutually exclusive flag to the map. |
| ` `[Set](https://developer.android.com/reference/java/util/Set)`<`[String](https://developer.android.com/reference/java/lang/String)`>` | ` `[get](https://developer.android.com/reference/android/view/inspector/IntFlagMapping#get(int))`(int value) ` Get a set of the names of enabled flags for a given property value.                                                                                        |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### IntFlagMapping

```
public IntFlagMapping ()
```

<br />

<br />

## Public methods

### add

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void add (int mask, 
                int target, 
                String name)
```

Add a mutually exclusive flag to the map.

<br />

|                                            Parameters                                             ||
|----------|-----------------------------------------------------------------------------------------|
| `mask`   | `int`: The bit mask to compare to and with a value <br />                               |
| `target` | `int`: The target value to compare the masked value with <br />                         |
| `name`   | `String`: The name of the flag to include if enabled This value cannot be`null`. <br /> |

### get

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Set<String> get (int value)
```

Get a set of the names of enabled flags for a given property value.

<br />

|                    Parameters                    ||
|---------|-----------------------------------------|
| `value` | `int`: The value of the property <br /> |

|                                                                                                              Returns                                                                                                               ||
|--------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [Set](https://developer.android.com/reference/java/util/Set)`<`[String](https://developer.android.com/reference/java/lang/String)`>` | The names of the enabled flags, empty if no flags enabled This value cannot be`null`. <br /> |