1 package androidx.room.integration.kotlintestapp.vo 2 3 import androidx.room.TypeConverter 4 import androidx.room.util.StringUtil 5 6 object StringToIntListConverters { 7 @TypeConverter 8 // Specifying that a static method should be generated. Otherwise, the compiler looks for the 9 // constructor of the class, and a object has a private constructor. 10 @JvmStatic stringToIntListnull11 fun stringToIntList(data: String?): List<Int>? = 12 if (data == null) null else StringUtil.splitToIntList(data) 13 14 @TypeConverter 15 @JvmStatic 16 fun intListToString(ints: List<Int>?): String? = 17 if (ints == null) null else StringUtil.joinIntoString(ints) 18 } 19