BuiltInTypeConverters

@Target(allowedTargets = )
@Retention(value = AnnotationRetention.BINARY)
annotation BuiltInTypeConverters


Flags to turn on/off extra type converters provided by Room.

For certain commonly used types (enums, UUID), Room provides automatic type converters. By default, these type converters are enabled but have lower priority than user provided type converters.

You can set these flags in the TypeConverters annotation to turn them off / on. It might be useful if you want to have more strict control over how these types are saved into the database.

Summary

Nested types

Control flags for built in converters.

Public constructors

Public properties

BuiltInTypeConverters.State

Controls whether Room can generate a TypeConverter for java.nio.ByteBuffer and use its ByteBuffer representation while saving it into database.

BuiltInTypeConverters.State

Controls whether Room can generate a TypeConverter for enum types and use their name() in the database.

BuiltInTypeConverters.State

Controls whether Room can generate a TypeConverter for java.util.UUID and use its byte[] representation while saving it into database.

Public constructors

BuiltInTypeConverters

BuiltInTypeConverters(
    enums: BuiltInTypeConverters.State = State.INHERITED,
    uuid: BuiltInTypeConverters.State = State.INHERITED,
    byteBuffer: BuiltInTypeConverters.State = State.INHERITED
)

Public properties

byteBuffer

val byteBufferBuiltInTypeConverters.State

Controls whether Room can generate a TypeConverter for java.nio.ByteBuffer and use its ByteBuffer representation while saving it into database.

By default, it is set to State.INHERITED (on by default unless set to another value in a higher scope).

enums

val enumsBuiltInTypeConverters.State

Controls whether Room can generate a TypeConverter for enum types and use their name() in the database.

By default, it is set to State.INHERITED (on by default unless set to another value in a higher scope).

uuid

val uuidBuiltInTypeConverters.State

Controls whether Room can generate a TypeConverter for java.util.UUID and use its byte[] representation while saving it into database.

By default, it is set to State.INHERITED (on by default unless set to another value in a higher scope).