# ThreadNetworkCredentials.SecurityPolicy

public static final class **ThreadNetworkCredentials.SecurityPolicy** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
The class represents Thread Security Policy.

### Public Constructor Summary

|---|---|
|   | [SecurityPolicy](https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy#SecurityPolicy(int,%20byte[]))(int rotationTimeHours, byte\[\] flags) Creates a new `https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy` object. |

### Public Method Summary

|---|---|
| boolean | [equals](https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) other) |
| byte\[\] | [getFlags](https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy#getFlags())() Returns 1 byte flags for Thread 1.1 or 2 bytes flags for Thread 1.2. |
| int | [getRotationTimeHours](https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy#getRotationTimeHours())() Returns the Security Policy Rotation Time in hours. |
| int | [hashCode](https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy#hashCode())() |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toString](https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy#toString())() |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Constructors

#### public **SecurityPolicy** (int rotationTimeHours, byte\[\] flags)

Creates a new `https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials.SecurityPolicy` object.

##### Parameters

| rotationTimeHours | the value for Thread key rotation in hours. Must be in range of 0x1-0xffff. |
| flags | security policy flags with length of either 1 byte for Thread 1.1 or 2 bytes for Thread 1.2 or higher. |
|---|---|

##### Throws

| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if `rotationTimeHours` is not in range of 0x1-0xffff or length of `flags` is smaller than `https://developers.home.google.com/android/reference/com/google/android/gms/threadnetwork/ThreadNetworkCredentials#LENGTH_MIN_SECURITY_POLICY_FLAGS`. |
|---|---|

## Public Methods

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) other)

#### public byte\[\] **getFlags** ()

Returns 1 byte flags for Thread 1.1 or 2 bytes flags for Thread 1.2.

#### public int **getRotationTimeHours** ()

Returns the Security Policy Rotation Time in hours.

#### public int **hashCode** ()

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toString** ()