# SecurityPatchState.VersionedSecurityPatchLevel

# SecurityPatchState.VersionedSecurityPatchLevel

Artifact:[androidx.security:security-state](https://developer.android.com/jetpack/androidx/releases/security)  
[View Source](https://cs.android.com/search?q=file:androidx/security/state/SecurityPatchState.kt+class:androidx.security.state.SecurityPatchState.VersionedSecurityPatchLevel)  
Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel "View this page in Java")

<br />

```
class SecurityPatchState.VersionedSecurityPatchLevel : SecurityPatchState.SecurityPatchLevel
```

<br />

|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                                                                    |||
| ↳ | [androidx.security.state.SecurityPatchState.SecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel)                      ||
|   | ↳ | [androidx.security.state.SecurityPatchState.VersionedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel) |

*** ** * ** ***

Implementation of[SecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel)for a versioned patch level.

## Summary

|                                                                     ### Public companion functions                                                                      |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SecurityPatchState.VersionedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel) | [fromString](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#fromString(kotlin.String))`(value: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Creates a new[VersionedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel)from a string representation of the version. |

|                                                                                                                                                                                                                                                                                                      ### Public constructors                                                                                                                                                                                                                                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [VersionedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#VersionedSecurityPatchLevel(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int))`(` ` majorVersion: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` minorVersion: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` buildVersion: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` patchVersion: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` |

|                                    ### Public functions                                     |
|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [compareTo](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#compareTo(androidx.security.state.SecurityPatchState.SecurityPatchLevel))`(other: `[SecurityPatchState.SecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel)`)` |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                 | [getBuildVersion](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#getBuildVersion())`()` Build version of the security patch level.                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                 | [getMajorVersion](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#getMajorVersion())`()` Major version of the security patch level.                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                 | [getMinorVersion](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#getMinorVersion())`()` Minor version of the security patch level.                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                 | [getPatchVersion](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#getPatchVersion())`()` Patch version of the security patch level.                                                                                                                                                                     |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)    | [toString](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel#toString())`()`                                                                                                                                                                                                                              |

## Public companion functions

### fromString

Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)  

```
fun fromString(value: String): SecurityPatchState.VersionedSecurityPatchLevel
```

Creates a new[VersionedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel)from a string representation of the version.  

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|----------------------------------------------------------------|
| `value: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | The version string in the format of "major.minor.build.patch". |

|                                                                                 Returns                                                                                 |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SecurityPatchState.VersionedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel) | A new[VersionedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel)representing the version. |

|                                                             Throws                                                             |
|--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [kotlin.IllegalArgumentException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html) | if the version string is not in the correct format. |

## Public constructors

### VersionedSecurityPatchLevel

Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)  

```
VersionedSecurityPatchLevel(
    majorVersion: Int,
    minorVersion: Int,
    buildVersion: Int = 0,
    patchVersion: Int = 0
)
```  

## Public functions

### compareTo

Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)  

```
open operator fun compareTo(other: SecurityPatchState.SecurityPatchLevel): Int
```  

### getBuildVersion

Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)  

```
fun getBuildVersion(): Int
```

Build version of the security patch level.  

### getMajorVersion

Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)  

```
fun getMajorVersion(): Int
```

Major version of the security patch level.  

### getMinorVersion

Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)  

```
fun getMinorVersion(): Int
```

Minor version of the security patch level.  

### getPatchVersion

Added in[1.0.0-beta01](https://developer.android.com/jetpack/androidx/releases/security#1.0.0-beta01)  

```
fun getPatchVersion(): Int
```

Patch version of the security patch level.  

### toString

```
open fun toString(): String
```