diff --git a/db/src/main/java/com/readrops/db/Converters.java b/db/src/main/java/com/readrops/db/Converters.java deleted file mode 100644 index 1939315f..00000000 --- a/db/src/main/java/com/readrops/db/Converters.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.readrops.db; - -import androidx.room.TypeConverter; - -import com.readrops.db.entities.account.AccountType; - -import org.joda.time.LocalDateTime; - -public class Converters { - - @TypeConverter - public LocalDateTime fromTimeStamp(Long value) { - return new LocalDateTime(value); - } - - @TypeConverter - public long fromLocalDateTime(LocalDateTime localDateTime) { - return localDateTime.toDateTime().getMillis(); - } - - @TypeConverter - public AccountType fromAccountTypeCode(int ordinal) { - return AccountType.values()[ordinal]; - } - - @TypeConverter - public int getAccountTypeCode(AccountType accountType) { - return accountType.ordinal(); - } - -} diff --git a/db/src/main/java/com/readrops/db/Converters.kt b/db/src/main/java/com/readrops/db/Converters.kt new file mode 100644 index 00000000..5291deeb --- /dev/null +++ b/db/src/main/java/com/readrops/db/Converters.kt @@ -0,0 +1,28 @@ +package com.readrops.db + +import androidx.room.TypeConverter +import com.readrops.db.entities.account.AccountType +import org.joda.time.LocalDateTime + +object Converters { + + @TypeConverter + fun fromTimeStamp(value: Long): LocalDateTime { + return LocalDateTime(value) + } + + @TypeConverter + fun fromLocalDateTime(localDateTime: LocalDateTime): Long { + return localDateTime.toDateTime().millis + } + + @TypeConverter + fun fromAccountTypeCode(ordinal: Int): AccountType { + return AccountType.values()[ordinal] + } + + @TypeConverter + fun getAccountTypeCode(accountType: AccountType): Int { + return accountType.ordinal + } +} \ No newline at end of file