# SecurityPatchState.DateBasedSecurityPatchLevel

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.DateBasedSecurityPatchLevel) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/security#1.0.0)

*** ** * ** ***

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


```
class SecurityPatchState.DateBasedSecurityPatchLevel : 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.DateBasedSecurityPatchLevel](https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel) |

*** ** * ** ***

Implementation of `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel` for a date-based patch level.

## Summary

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

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#DateBasedSecurityPatchLevel(kotlin.Int,kotlin.Int,kotlin.Int)(year: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, month: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, day: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#compareTo(androidx.security.state.SecurityPatchState.SecurityPatchLevel)(other: https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.SecurityPatchLevel)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#getDay()()` Day of the security patch level. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#getMonth()()` Month of the security patch level. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#getYear()()` Year of the security patch level. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#toString()()` |

## Public companion functions

### fromString

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

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

Creates a new `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` from a string representation of the date.

| Parameters |
|---|---|
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The date string in the format of `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel.Companion#DATE_FORMATS()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` | A new `https://developer.android.com/reference/kotlin/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` representing the date. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the date string is not in the correct format. |

## Public constructors

### DateBasedSecurityPatchLevel

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

```
DateBasedSecurityPatchLevel(year: Int, month: Int, day: Int)
```

## Public functions

### compareTo

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

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

### getDay

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

```
fun getDay(): Int
```

Day of the security patch level.

### getMonth

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

```
fun getMonth(): Int
```

Month of the security patch level.

### getYear

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

```
fun getYear(): Int
```

Year of the security patch level.

### toString

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