Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/content/RestrictionEntry#constants) \| [Inherited Constants](https://developer.android.com/reference/android/content/RestrictionEntry#inhconstants) \| [Fields](https://developer.android.com/reference/android/content/RestrictionEntry#lfields) \| [Ctors](https://developer.android.com/reference/android/content/RestrictionEntry#pubctors) \| [Methods](https://developer.android.com/reference/android/content/RestrictionEntry#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/RestrictionEntry#inhmethods)

# RestrictionEntry

*** ** * ** ***

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


`
public


class
RestrictionEntry
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.RestrictionEntry |

<br />

*** ** * ** ***

Applications can expose restrictions for a restricted user on a
multiuser device. The administrator can configure these restrictions that will then be
applied to the restricted user. Each RestrictionsEntry is one configurable restriction.

<br />

Any application that chooses to expose such restrictions does so by implementing a receiver that handles the `https://developer.android.com/reference/android/content/Intent#ACTION_GET_RESTRICTION_ENTRIES` action. The receiver then returns a result bundle that contains an entry called "restrictions", whose value is an ArrayList.

<br />

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BOOLEAN` Restriction of type "bool". |
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE` Restriction of type "bundle". |
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE_ARRAY` Restriction of type "bundle_array". |
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_CHOICE` Restriction of type "choice". |
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_INTEGER` Restriction of type "integer". |
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT` Restriction of type "multi-select". |
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_NULL` Hidden restriction type. |
| `int` | `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_STRING` Restriction of type "string". |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/content/RestrictionEntry>` | `https://developer.android.com/reference/android/content/RestrictionEntry#CREATOR` |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/content/RestrictionEntry#RestrictionEntry(android.os.Parcel)(https://developer.android.com/reference/android/os/Parcel in) ` |
| ` https://developer.android.com/reference/android/content/RestrictionEntry#RestrictionEntry(int,%20java.lang.String)(int type, https://developer.android.com/reference/java/lang/String key) ` Constructor for specifying the type and key, with no initial value; |
| ` https://developer.android.com/reference/android/content/RestrictionEntry#RestrictionEntry(java.lang.String,%20boolean)(https://developer.android.com/reference/java/lang/String key, boolean selectedState) ` Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BOOLEAN` type. |
| ` https://developer.android.com/reference/android/content/RestrictionEntry#RestrictionEntry(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String key, int selectedInt) ` Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_INTEGER` type. |
| ` https://developer.android.com/reference/android/content/RestrictionEntry#RestrictionEntry(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String key, https://developer.android.com/reference/java/lang/String selectedString) ` Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_CHOICE` type. |
| ` https://developer.android.com/reference/android/content/RestrictionEntry#RestrictionEntry(java.lang.String,%20java.lang.String[])(https://developer.android.com/reference/java/lang/String key, https://developer.android.com/reference/java/lang/String selectedStrings) ` Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT` type. |

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/android/content/RestrictionEntry` | ` https://developer.android.com/reference/android/content/RestrictionEntry#createBundleArrayEntry(java.lang.String,%20android.content.RestrictionEntry[])(https://developer.android.com/reference/java/lang/String key, https://developer.android.com/reference/android/content/RestrictionEntry restrictionEntries) ` Creates an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE_ARRAY`. |
| ` static https://developer.android.com/reference/android/content/RestrictionEntry` | ` https://developer.android.com/reference/android/content/RestrictionEntry#createBundleEntry(java.lang.String,%20android.content.RestrictionEntry[])(https://developer.android.com/reference/java/lang/String key, https://developer.android.com/reference/android/content/RestrictionEntry restrictionEntries) ` Creates an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE`. |
| ` int` | ` https://developer.android.com/reference/android/content/RestrictionEntry#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` boolean` | ` https://developer.android.com/reference/android/content/RestrictionEntry#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Indicates whether some other object is "equal to" this one. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getAllSelectedStrings()() ` Returns the list of currently selected values. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getChoiceEntries()() ` Returns the list of strings, set earlier, that will be presented as choices to the user. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getChoiceValues()() ` Returns the list of possible string values set earlier. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getDescription()() ` Returns the provided user-visible description of the entry, if any. |
| ` int` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getIntValue()() ` Returns the value of the entry as an integer when the type is `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_INTEGER`. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getKey()() ` This is the unique key for the restriction entry. |
| ` https://developer.android.com/reference/android/content/RestrictionEntry` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getRestrictions()() ` Returns array of possible restriction entries that this entry may contain. |
| ` boolean` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getSelectedState()() ` Returns the current selected state for an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BOOLEAN`. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getSelectedString()() ` Returns the currently selected string value. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getTitle()() ` Returns the user-visible title for the entry, if any. |
| ` int` | ` https://developer.android.com/reference/android/content/RestrictionEntry#getType()() ` Returns the type for this restriction. |
| ` int` | ` https://developer.android.com/reference/android/content/RestrictionEntry#hashCode()() ` Returns a hash code value for the object. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setAllSelectedStrings(java.lang.String[])(https://developer.android.com/reference/java/lang/String allSelectedStrings) ` Sets the current list of selected values for an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT`. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceEntries(android.content.Context,%20int)(https://developer.android.com/reference/android/content/Context context, int stringArrayResId) ` Sets a list of strings that will be presented as choices to the user. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceEntries(java.lang.String[])(https://developer.android.com/reference/java/lang/String choiceEntries) ` Sets a list of strings that will be presented as choices to the user. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])(https://developer.android.com/reference/java/lang/String choiceValues) ` Sets a list of string values that can be selected by the user. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(android.content.Context,%20int)(https://developer.android.com/reference/android/content/Context context, int stringArrayResId) ` Sets a list of string values that can be selected by the user, similar to `https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])`. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setDescription(java.lang.String)(https://developer.android.com/reference/java/lang/String description) ` Sets the user-visible description of the entry, as a possible sub-text for the title. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setIntValue(int)(int value) ` Sets the integer value of the entry when the type is `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_INTEGER`. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setRestrictions(android.content.RestrictionEntry[])(https://developer.android.com/reference/android/content/RestrictionEntry restrictions) ` Sets an array of possible restriction entries, that this entry may contain. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setSelectedState(boolean)(boolean state) ` Sets the current selected state for an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BOOLEAN`. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setSelectedString(java.lang.String)(https://developer.android.com/reference/java/lang/String selectedString) ` Sets the string value to use as the selected value for this restriction. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setTitle(java.lang.String)(https://developer.android.com/reference/java/lang/String title) ` Sets the user-visible title for the entry. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#setType(int)(int type) ` Sets the type for this restriction. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/RestrictionEntry#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/content/RestrictionEntry#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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*. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### TYPE_BOOLEAN

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

```
public static final int TYPE_BOOLEAN
```

Restriction of type "bool". Use this for storing a boolean value, typically presented as
a checkbox in the UI.

<br />

Constant Value:

1
(0x00000001)


### TYPE_BUNDLE

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

```
public static final int TYPE_BUNDLE
```

Restriction of type "bundle". Use this for storing `https://developer.android.com/reference/android/os/Bundle` of
restrictions

<br />

Constant Value:

7
(0x00000007)


### TYPE_BUNDLE_ARRAY

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

```
public static final int TYPE_BUNDLE_ARRAY
```

Restriction of type "bundle_array". Use this for storing arrays of
`https://developer.android.com/reference/android/os/Bundle` of restrictions

<br />

Constant Value:

8
(0x00000008)


### TYPE_CHOICE

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

```
public static final int TYPE_CHOICE
```

Restriction of type "choice". Use this for storing a string value, typically presented as
a single-select list. Call `https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceEntries(java.lang.String[])` and
`https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])` to set the localized list entries to present to the user
and the corresponding values, respectively.

<br />

Constant Value:

2
(0x00000002)


### TYPE_INTEGER

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

```
public static final int TYPE_INTEGER
```

Restriction of type "integer". Use this for storing an integer value. The range of values
is from `https://developer.android.com/reference/java/lang/Integer#MIN_VALUE` to `https://developer.android.com/reference/java/lang/Integer#MAX_VALUE`.

<br />

Constant Value:

5
(0x00000005)


### TYPE_MULTI_SELECT

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

```
public static final int TYPE_MULTI_SELECT
```

Restriction of type "multi-select". Use this for presenting a multi-select list where more
than one entry can be selected, such as for choosing specific titles to allowlist.
Call `https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceEntries(java.lang.String[])` and
`https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])` to set the localized list entries to present to the user
and the corresponding values, respectively.
Use `https://developer.android.com/reference/android/content/RestrictionEntry#getAllSelectedStrings()` and `https://developer.android.com/reference/android/content/RestrictionEntry#setAllSelectedStrings(java.lang.String[])` to
manipulate the selections.

<br />

Constant Value:

4
(0x00000004)


### TYPE_NULL

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

```
public static final int TYPE_NULL
```

Hidden restriction type. Use this type for information that needs to be transferred
across but shouldn't be presented to the user in the UI. Stores a single String value.

<br />

Constant Value:

0
(0x00000000)


### TYPE_STRING

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

```
public static final int TYPE_STRING
```

Restriction of type "string". Use this for storing a string value.

<br />

**See also:**

- `https://developer.android.com/reference/android/content/RestrictionEntry#setSelectedString(java.lang.String)`
- `https://developer.android.com/reference/android/content/RestrictionEntry#getSelectedString()`

Constant Value:

6
(0x00000006)


## Fields

### CREATOR

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

```
public static final Creator<RestrictionEntry> CREATOR
```

<br />

<br />

## Public constructors

### RestrictionEntry

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

```
public RestrictionEntry (Parcel in)
```

<br />

<br />

| Parameters ||
|---|---|
| `in` | `Parcel` <br /> |

### RestrictionEntry

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

```
public RestrictionEntry (int type, 
                String key)
```

Constructor for specifying the type and key, with no initial value;

<br />

| Parameters ||
|---|---|
| `type` | `int`: the restriction type. <br /> |
| `key` | `String`: the unique key for this restriction <br /> |

### RestrictionEntry

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

```
public RestrictionEntry (String key, 
                boolean selectedState)
```

Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BOOLEAN` type.

<br />

| Parameters ||
|---|---|
| `key` | `String`: the unique key for this restriction <br /> |
| `selectedState` | `boolean`: whether this restriction is selected or not <br /> |

### RestrictionEntry

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

```
public RestrictionEntry (String key, 
                int selectedInt)
```

Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_INTEGER` type.

<br />

| Parameters ||
|---|---|
| `key` | `String`: the unique key for this restriction <br /> |
| `selectedInt` | `int`: the integer value of the restriction <br /> |

### RestrictionEntry

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

```
public RestrictionEntry (String key, 
                String selectedString)
```

Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_CHOICE` type.

<br />

| Parameters ||
|---|---|
| `key` | `String`: the unique key for this restriction <br /> |
| `selectedString` | `String`: the current value <br /> |

### RestrictionEntry

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

```
public RestrictionEntry (String key, 
                String[] selectedStrings)
```

Constructor for `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT` type.

<br />

| Parameters ||
|---|---|
| `key` | `String`: the unique key for this restriction <br /> |
| `selectedStrings` | `String`: the list of values that are currently selected <br /> |

## Public methods

### createBundleArrayEntry

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

```
public static RestrictionEntry createBundleArrayEntry (String key, 
                RestrictionEntry[] restrictionEntries)
```

Creates an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE_ARRAY`.

<br />

| Parameters ||
|---|---|
| `key` | `String`: the unique key for this restriction <br /> |
| `restrictionEntries` | `RestrictionEntry`: array of nested restriction entries. The array may only contain elements of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/RestrictionEntry` | the newly created restriction <br /> |

### createBundleEntry

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

```
public static RestrictionEntry createBundleEntry (String key, 
                RestrictionEntry[] restrictionEntries)
```

Creates an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE`.

<br />

| Parameters ||
|---|---|
| `key` | `String`: the unique key for this restriction <br /> |
| `restrictionEntries` | `RestrictionEntry`: array of nested restriction entries. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/RestrictionEntry` | the newly created restriction <br /> |

### describeContents

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

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### equals

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

```
public boolean equals (Object o)
```

Indicates whether some other object is "equal to" this one.


The `equals` method implements an equivalence relation
on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.


An equivalence relation partitions the elements it operates on
into *equivalence classes*; all the members of an
equivalence class are equal to each other. Members of an
equivalence class are substitutable for each other, at least
for some purposes.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getAllSelectedStrings

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

```
public String[] getAllSelectedStrings ()
```

Returns the list of currently selected values.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the list of current selections, if type is `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT`, null otherwise. <br /> |

### getChoiceEntries

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

```
public String[] getChoiceEntries ()
```

Returns the list of strings, set earlier, that will be presented as choices to the user.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the list of choices presented to the user. <br /> |

### getChoiceValues

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

```
public String[] getChoiceValues ()
```

Returns the list of possible string values set earlier.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the list of possible values. <br /> |

### getDescription

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

```
public String getDescription ()
```

Returns the provided user-visible description of the entry, if any.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the user-visible description, null if none was set earlier. <br /> |

### getIntValue

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

```
public int getIntValue ()
```

Returns the value of the entry as an integer when the type is `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_INTEGER`.

<br />

| Returns ||
|---|---|
| `int` | the integer value of the entry. <br /> |

### getKey

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

```
public String getKey ()
```

This is the unique key for the restriction entry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the key for the restriction. <br /> |

### getRestrictions

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

```
public RestrictionEntry[] getRestrictions ()
```

Returns array of possible restriction entries that this entry may contain.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/RestrictionEntry` | <br /> |

### getSelectedState

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

```
public boolean getSelectedState ()
```

Returns the current selected state for an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BOOLEAN`.

<br />

| Returns ||
|---|---|
| `boolean` | the current selected state of the entry. <br /> |

### getSelectedString

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

```
public String getSelectedString ()
```

Returns the currently selected string value.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the currently selected value, which can be null for types that aren't for holding single string values. <br /> |

### getTitle

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

```
public String getTitle ()
```

Returns the user-visible title for the entry, if any.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the user-visible title for the entry, null if none was set earlier. <br /> |

### getType

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

```
public int getType ()
```

Returns the type for this restriction.

<br />

| Returns ||
|---|---|
| `int` | the type for this restriction <br /> |

### hashCode

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

```
public int hashCode ()
```

Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
`https://developer.android.com/reference/java/util/HashMap`.


The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### setAllSelectedStrings

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

```
public void setAllSelectedStrings (String[] allSelectedStrings)
```

Sets the current list of selected values for an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT`.
These values will be persisted by the system for later use by the application.

<br />

| Parameters ||
|---|---|
| `allSelectedStrings` | `String`: the current list of selected values. <br /> |

### setChoiceEntries

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

```
public void setChoiceEntries (Context context, 
                int stringArrayResId)
```

Sets a list of strings that will be presented as choices to the user. This is similar to
`https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceEntries(java.lang.String[])`.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: the application context, used for retrieving the resources. <br /> |
| `stringArrayResId` | `int`: the resource id of a string array containing the possible entries. <br /> |

### setChoiceEntries

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

```
public void setChoiceEntries (String[] choiceEntries)
```

Sets a list of strings that will be presented as choices to the user. When the
user selects one or more of these choices, the corresponding value from the possible values
are stored as the selected strings. The size of this array must match the size of the array
set in `https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])`. This method is not relevant for types other
than `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_CHOICE`, and `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT`.

<br />

| Parameters ||
|---|---|
| `choiceEntries` | `String`: the list of user-visible choices. <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])`

### setChoiceValues

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

```
public void setChoiceValues (String[] choiceValues)
```

Sets a list of string values that can be selected by the user. If no user-visible entries
are set by a call to `https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceEntries(java.lang.String[])`, these values will be the ones
shown to the user. Values will be chosen from this list as the user's selection and the
selected values can be retrieved by a call to `https://developer.android.com/reference/android/content/RestrictionEntry#getAllSelectedStrings()`, or
`https://developer.android.com/reference/android/content/RestrictionEntry#getSelectedString()`, depending on whether it is a multi-select type or choice type.
This method is not relevant for types other than
`https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_CHOICE`, and `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_MULTI_SELECT`.

<br />

| Parameters ||
|---|---|
| `choiceValues` | `String`: an array of Strings which will be the selected values for the user's selections. <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/RestrictionEntry#getChoiceValues()`
- `https://developer.android.com/reference/android/content/RestrictionEntry#getAllSelectedStrings()`

### setChoiceValues

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

```
public void setChoiceValues (Context context, 
                int stringArrayResId)
```

Sets a list of string values that can be selected by the user, similar to
`https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])`.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: the application context for retrieving the resources. <br /> |
| `stringArrayResId` | `int`: the resource id for a string array containing the possible values. <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/RestrictionEntry#setChoiceValues(java.lang.String[])`

### setDescription

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

```
public void setDescription (String description)
```

Sets the user-visible description of the entry, as a possible sub-text for the title.
You can use this to describe the entry in more detail or to display the current state of
the restriction.

<br />

| Parameters ||
|---|---|
| `description` | `String`: the user-visible description string. <br /> |

### setIntValue

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

```
public void setIntValue (int value)
```

Sets the integer value of the entry when the type is `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_INTEGER`.

<br />

| Parameters ||
|---|---|
| `value` | `int`: the integer value to set. <br /> |

### setRestrictions

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

```
public void setRestrictions (RestrictionEntry[] restrictions)
```

Sets an array of possible restriction entries, that this entry may contain.

This method is only relevant for types `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE` and
`https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BUNDLE_ARRAY`

<br />

| Parameters ||
|---|---|
| `restrictions` | `RestrictionEntry` <br /> |

### setSelectedState

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

```
public void setSelectedState (boolean state)
```

Sets the current selected state for an entry of type `https://developer.android.com/reference/android/content/RestrictionEntry#TYPE_BOOLEAN`. This value will
be persisted by the system for later use by the application.

<br />

| Parameters ||
|---|---|
| `state` | `boolean`: the current selected state <br /> |

### setSelectedString

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

```
public void setSelectedString (String selectedString)
```

Sets the string value to use as the selected value for this restriction. This value will
be persisted by the system for later use by the application.

<br />

| Parameters ||
|---|---|
| `selectedString` | `String`: the string value to select. <br /> |

### setTitle

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

```
public void setTitle (String title)
```

Sets the user-visible title for the entry.

<br />

| Parameters ||
|---|---|
| `title` | `String`: the user-visible title for the entry. <br /> |

### setType

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

```
public void setType (int type)
```

Sets the type for this restriction.

<br />

| Parameters ||
|---|---|
| `type` | `int`: the type for this restriction. <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

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

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |