BuiltInTypeConverters


@Target(allowedTargets = )
@Retention(value = AnnotationRetention.BINARY)
public 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

public enum BuiltInTypeConverters.State extends Enum

Control flags for built in converters.

Public methods

final @NonNull BuiltInTypeConverters.State

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

final @NonNull BuiltInTypeConverters.State

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

final @NonNull 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

public BuiltInTypeConverters(
    @NonNull BuiltInTypeConverters.State enums,
    @NonNull BuiltInTypeConverters.State uuid,
    @NonNull BuiltInTypeConverters.State byteBuffer
)

Public methods

getByteBuffer

public final @NonNull BuiltInTypeConverters.State getByteBuffer()

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

getEnums

public final @NonNull BuiltInTypeConverters.State getEnums()

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

getUuid

public final @NonNull BuiltInTypeConverters.State getUuid()

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