package com.ux.video.file.filerecovery.db

import com.ux.video.file.filerecovery.utils.FileType
import io.objectbox.converter.PropertyConverter

class FileTypeConverter : PropertyConverter<FileType, Int> {

    override fun convertToDatabaseValue(entityProperty: FileType?): Int? {
        return entityProperty?.value
    }

    override fun convertToEntityProperty(databaseValue: Int?): FileType? {
        return FileType.entries.find { it.value == databaseValue }
    }
}
