Skip to content

Commit

Permalink
refactor: remove now unnecessary @JvmStatic annotation for object Typ…
Browse files Browse the repository at this point in the history
…eConverters
  • Loading branch information
cbeyls committed Nov 17, 2024
1 parent 40d0de6 commit dd441e9
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ import be.digitalia.fosdem.model.Person
import be.digitalia.fosdem.model.Track

object GlobalTypeConverters {
@JvmStatic
@TypeConverter
fun fromDay(day: Day): Long = day.index.toLong()

@JvmStatic
@TypeConverter
fun fromTrack(track: Track): Long = track.id

@JvmStatic
@TypeConverter
fun fromPerson(person: Person): Long = person.id

@JvmStatic
@TypeConverter
fun fromEvent(event: Event): Long = event.id
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import androidx.room.TypeConverter
import java.time.Instant

object NonNullInstantTypeConverters {
@JvmStatic
@TypeConverter
fun toInstant(value: Long): Instant = Instant.ofEpochSecond(value)

@JvmStatic
@TypeConverter
fun fromInstant(value: Instant): Long = value.epochSecond
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import androidx.room.TypeConverter
import java.time.LocalDate

object NonNullLocalDateTypeConverters {
@JvmStatic
@TypeConverter
fun toLocalDate(value: Long): LocalDate = LocalDate.ofEpochDay(value)

@JvmStatic
@TypeConverter
fun fromLocalDate(value: LocalDate): Long = value.toEpochDay()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import androidx.room.TypeConverter
import java.time.Instant

object NullableInstantTypeConverters {
@JvmStatic
@TypeConverter
fun toInstant(value: Long?): Instant? = value?.let { Instant.ofEpochSecond(it) }

@JvmStatic
@TypeConverter
fun fromInstant(value: Instant?): Long? = value?.epochSecond
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import androidx.room.TypeConverter
import java.time.ZoneOffset

object NullableZoneOffsetTypeConverters {
@JvmStatic
@TypeConverter
fun toZoneOffset(value: Int?): ZoneOffset? = value?.let { ZoneOffset.ofTotalSeconds(it) }

@JvmStatic
@TypeConverter
fun fromZoneOffset(value: ZoneOffset?): Int? = value?.totalSeconds
}

0 comments on commit dd441e9

Please sign in to comment.