# CacheSettings.Storage


```
enum CacheSettings.Storage : Enum
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html) ||
|   | ↳ | [com.google.firebase.dataconnect.CacheSettings.Storage](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings.Storage) |

*** ** * ** ***

The types of cache storage supported by `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/FirebaseDataConnect` in its `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings` setting.

## Summary

| ### Enum Values |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings.Storage#MEMORY` | Cached data is stored ephemerally in memory. |
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings.Storage#PERSISTENT` | Cached data is stored persistently on the device's local file system. |

| ### Public functions |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings.Storage` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings.Storage#valueOf(kotlin.String)(value: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings.Storage>` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/CacheSettings.Storage#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

## Enum Values

### MEMORY

```
val CacheSettings.Storage.MEMORY: CacheSettings.Storage
```

Cached data is stored ephemerally in memory.

This storage is extremely fast, but the data is lost entirely when the application process terminates. It is isolated to the current process and cannot be shared. Note that this cache consumes RAM while the process is running.

### PERSISTENT

```
val CacheSettings.Storage.PERSISTENT: CacheSettings.Storage
```

Cached data is stored persistently on the device's local file system.

This storage ensures data is retained across application restarts and device reboots. Because the data is persisted to disk, it may be accessed by multiple processes within the same application. Note that the data is stored in a directory that will be picked up by Android's [Auto Backup](https://developer.android.com/identity/data/autobackup) feature.

## Public functions

### valueOf

```
fun valueOf(value: String): CacheSettings.Storage
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `kotlin.IllegalArgumentException: kotlin.IllegalArgumentException` | if this enum type has no constant with the specified name |

### values

```
fun values(): Array<CacheSettings.Storage>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.