# 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)

*** ** * ** ***


```
public final class SecurityPatchState.DateBasedSecurityPatchLevel extends SecurityPatchState.SecurityPatchLevel
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.security.state.SecurityPatchState.SecurityPatchLevel](https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel) ||
|   | ↳ | [androidx.security.state.SecurityPatchState.DateBasedSecurityPatchLevel](https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel) |

*** ** * ** ***

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

## Summary

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

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#compareTo(androidx.security.state.SecurityPatchState.SecurityPatchLevel)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel other)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` | `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#fromString(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html value)` Creates a new `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` from a string representation of the date. |
| `final int` | `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#getDay()()` Day of the security patch level. |
| `final int` | `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#getMonth()()` Month of the security patch level. |
| `final int` | `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#getYear()()` Year of the security patch level. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel#toString()()` |

## Public constructors

### DateBasedSecurityPatchLevel

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

```
public DateBasedSecurityPatchLevel(int year, int month, int day)
```

## Public methods

### compareTo

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

```
public int compareTo(@NonNull SecurityPatchState.SecurityPatchLevel other)
```

### fromString

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

```
public static final @NonNull SecurityPatchState.DateBasedSecurityPatchLevel fromString(@NonNull String value)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html value` | The date string in the format of `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel.Companion#DATE_FORMATS()`. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` | A new `https://developer.android.com/reference/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. |

### getDay

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

```
public final int getDay()
```

Day of the security patch level.

### getMonth

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

```
public final int getMonth()
```

Month of the security patch level.

### getYear

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

```
public final int getYear()
```

Year of the security patch level.

### toString

```
public @NonNull String toString()
```