# OperationType

Artifact: [androidx.room3:room3-common](https://developer.android.com/jetpack/androidx/releases/room3) [View Source](https://cs.android.com/search?q=file:androidx/room3/DaoReturnTypeConverter.kt+class:androidx.room3.OperationType) Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  enum OperationType : Enum<OperationType>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[OperationType](https://developer.android.com/reference/kotlin/androidx/room3/OperationType)\> ||
|   | ↳ | [androidx.room3.OperationType](https://developer.android.com/reference/kotlin/androidx/room3/OperationType) |

*** ** * ** ***

Describes the type of database operation a `https://developer.android.com/reference/kotlin/androidx/room3/DaoReturnTypeConverter` function supports.

A converter function defines the operation type it supports to provide distinct logic between `https://developer.android.com/reference/kotlin/androidx/room3/OperationType#READ` (`https://developer.android.com/reference/kotlin/androidx/room3/Query`) versus `https://developer.android.com/reference/kotlin/androidx/room3/OperationType#WRITE` (`https://developer.android.com/reference/kotlin/androidx/room3/Insert`, `https://developer.android.com/reference/kotlin/androidx/room3/Update`, `https://developer.android.com/reference/kotlin/androidx/room3/Delete`, and `https://developer.android.com/reference/kotlin/androidx/room3/Upsert`) operations.

Note that `INSERT`, `UPDATE`, and `DELETE` statements executed within a `https://developer.android.com/reference/kotlin/androidx/room3/Query` annotation are also considered write operations.

If a converter function is used for a write operation, its return type's parameterized types are limited to those supported by Room's write operations. Write converters can't also have a `RoomRawQuery` or tables names as parameters.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/OperationType#READ` |   |
| `https://developer.android.com/reference/kotlin/androidx/room3/OperationType#WRITE` |   |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/OperationType` | `https://developer.android.com/reference/kotlin/androidx/room3/OperationType#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/room3/OperationType>` | `https://developer.android.com/reference/kotlin/androidx/room3/OperationType#values()()` Returns an array containing the constants of this enum type, in the order they're declared. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/room3/OperationType>` | `https://developer.android.com/reference/kotlin/androidx/room3/OperationType#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. | Cmn |

## Enum Values

### READ

```
val OperationType.READ: OperationType
```

### WRITE

```
val OperationType.WRITE: OperationType
```

## Public functions

### valueOf

Cmn Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

```
fun valueOf(value: String): OperationType
```

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 |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

Cmn Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

```
fun values(): Array<OperationType>
```

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.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

Cmn

```
val entries: EnumEntries<OperationType>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.